Joomla: 0 Call to a member function get() on string - content-management-system

I would like to edit the Joomla events and unfortunatley, it is not allowing me to edit. The error is unclear. What could be the problem?

Related

object to fluid.form on other page

Im trying to redirect from a list of entries to the edit page for these entries when an link.action is clicked.
I can't seem to get the values from the objects using the 'property' tag once I redirect to the editing page.
The action 'edit' is not getting executed on the page I redirect to. Instead it fires the standard action which is just listing all the entries.
public function toEditAction(Personenliste $person) {
$this->redirect('edit', 'Listen', 'testprivateext', ['personenliste' => $person], 43);
}
public function editAction(Personenliste $person) {
$this->view->assign('personenliste',$person);
return $this->htmlResponse();
}
The call is done via link.action. (I also tried directly redirecting the action with the 'pageUid'-tag)
<f:link.action action="toEdit" arguments="{person:'{person}'}" extensionName="testprivateext" controller="Listen" pluginName="pi1">&#128393</f:link.action>
This is not an answer to your question (because you already solved it), but a little info for more readable inline-fluid.
This:
arguments="{person:'{person}'}"
can be written:
arguments="{person: person}"
when you directly pass a variable, you can discard the quotes and curly braces.
but you will need it, when passing a VH:
arguments="{person:'{person -> f:format.raw()}'}"
Have a nice day :)

Apache Isis: How to implement your custom submit form or page properly?

I'm new at Apache Isis and I'm stuck.
I want to create my own submit form with editable parameters for search some entities and a grid with search results below.
Firstly, I created #DomainObject(nature=Nature.VIEW_MODEL) with search results collection, parameters for search and #Action for search.
After deeper research, I found out strict implementations for actions (For exapmle ActionParametersFormPanel). Can I use #Action and edit #DomainObject properties(my search parameters for action) without prompts?
Can I implement it by layout.xml?
Then I tried to change a component as described here: 6.2 Replacing page elements, but I was confused which ComponentType and IModel should I use, maybe ComponentType.PARAMETERS and ActionModel or implement my own IModel for my case.
Should I implement my own Wicket page for search and register it by PageClassList interface, as described here: 6.3 Custom pages
As I understood I need to replace page class for one of PageType, but which one should I change?
So, the question is how to implement such issues properly? Which way should I choose?
Thank you!
===================== UPDATE ===================
I've implemented HomePageViewModel in this way:
#DomainObject(
nature = Nature.VIEW_MODEL,
objectType = "homepage.HomePageViewModel"
)
#Setter #Getter
public class HomePageViewModel {
private String id;
private String type;
public TranslatableString title() {
return TranslatableString.tr("My custom search");
}
public List<SimpleObject> getObjects() {
return simpleObjectRepository.listAll();
}
#Action
public HomePageViewModel search(
#ParameterLayout(named = "Id")
String id,
#ParameterLayout(named = "Type")
String type
){
setId(id);
setType(type);
// finding objects by entered parameters is not implemented yet
return this;
}
#javax.inject.Inject
SimpleObjectRepository simpleObjectRepository;
}
And it works in this way:
I want to implement a built-in-ViewModel action with parameters without any dialog windows, smth like this:
1) Is it possible to create smth like ActionParametersFormPanel based on ComponentType.PARAMETERS and ActionModel and use this component as #Action in my ViewModel?
2) Or I should use, as you said, ComponentType.COLLECTION_CONTENTS? As I inderstand my search result grid and my search input panel will be like ONE my stub component?
Thank you.
We have a JIRA ticket in our JIRA to implement a filterable/searchable component, but it hasn't yet made it to the top of the list for implementation.
As an alternative, you could have a view model that provides the parameters you want to filter on as properties, with a table underneath. (I see you asked another question here on SO re properties on view models, so perhaps you are moving in that direction also... I've answered that question).
If you do want to have a stab at implementing that ticket, then the ComponentTYpe to use is COLLECTION_CONTENTS. If you take a look at the isisaddons, eg for excel or gmap3 then it might help get you started.
======= UPDATE TO ANSWER (based on update made to query) ==========
I have some good news for you. v1.15.0-SNAPSHOT, which should be released in the couple of weeks, has support for "inline prompts". You should find these give a user experience very similar to what you are after, with no further work needed on your part.
To try it out, check out the current trunk, and then load the simpleapp (in examples/application/simpleapp). You should see that editing properties and invoking actions uses the new inline prompt style.
HTH
Dan

Property Mapping Exception in Helhum upload example

I am using helhum File Upload Demo to upload the images. But currently i got below error.
Exception while property mapping at property path "images.0":Property "name" was not found in target object of type "XXXX\XXXXX\Domain\Model\FileReference
Please help here.. How can i move forward.
Thanks in advace.
If you followed the example extension, you are maybe missing the registration of UploadedFileReferenceConverter and ObjectStorageConverter in your ext_localconf.php. Took me a day to find that one:
ext_localconf.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Vendor\\EXT\\Property\\TypeConverter\\UploadedFileReferenceConverter');
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Vendor\\EXT\\Property\\TypeConverter\\ObjectStorageConverter');
In the initializeUpdateAction (or initializeCreateAction) you have to use the name of the parameter in the updateAction (or createAction) as argument.
If your updateAction looks like this:
public function updateAction(\Classname $yourObject)
You have to call the helhum function with the argument:
$this->setTypeConverterConfigurationForImageUpload('yourObject');
As a small hint for later problems: In the setTypeConverterConfigurationForImageUpload function you should register your own file attributes if they are not named image and/or imageCollection.0 like in the example.

mshtml fireevent onchange not firing

I am unable to fire an "onchange" event in mshtml. Can you please tell me what I am doing wrong here.
HTMLSelectElement element = (HTMLSelectElement)this.HTMLDocument.all.item(controlId, 0);
IHTMLElement e = element as IHTMLElement;
IHTMLDocument4 doc = e.document as IHTMLDocument4;
object dummy = null;
object eventObj = doc.CreateEventObject(ref dummy);
HTMLSelectElementClass se = element as HTMLSelectElementClass;
se.FireEvent("onchange", ref eventObj);
I am getting variable "se" as null. I got this piece of code from another link http://www.itwriting.com/phorum/read.php?3,1507
Can anyone help me with this.
Thanks,
Sam
Runtime Callable Wrapper objects generated by COM calls like HTMLDocument.all.item can translate interface casting to QueryInterface calls. But the RCW does not know how to convert to a managed class like HTMLSelectElementClass, thus it returns null.
Instead of casting to HTMLSelectElementClass, cast to IHTMLElement3 to call fireEvent.
By the way, your code does not work in IE11 mode as document.all is deprecated. Use IHTMLDocument3::getElementById instead.
I had tried all those which Sheng mentioned but didn't work.
This issue was solved by injecting javascript code for "onchange" and executing it. It worked.

Redirect to last page when overlay comment-form is used

I've got a view (phase4) with some custom content type content in it, where the users may comment on.
When the users want to comment, the comment form should appear in a modal form. I solved this by using the admin overlay.
Adding following function to my custom module:
function phase2_admin_paths_alter(&$paths) {
$paths['comment/reply/*'] = TRUE;
}
and using following link:
Comment
to open the comment form in a modal way. So far so good... but....
How do I redirect the user back to the page, the user was coming from.
I know that I have to overwrite the #action of the form in the template_form_FORMID_alter, like
$form['#action'] = $lasturl;
but how do I get the last url, so that it is reusable (so hardcoding the url isn't an option)?
My first idea was that I transfer the last url by adding it to the url as a $_GET-parameter, but it looks like this:
www.example.com/phase4#overlay=comment/reply/161%3Furl%3Dphase4
I also tried it with drupal_get_destination(), but either with no success, because of the tranformation of the "?" and the "=" in the url.
Are there other ways to find out where the user was coming from?
Note: phase4 isn't the alias of node 161. Phase 4 is a view, where node 161 is an element of.
Cheers
Tom
You have to use the drupal_get_destination() function with l() function to create such links.
$destination = drupal_get_destination(); // Store current path
Comment