? Success

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
17 May 2015

$data in JModelForm::preprocessData need to be linked, otherwise any changes made by plugin on onContentPrepareData have no effect when $data is array

test
add event onContentPrepareData into the content plugin:

public function onContentPrepareData($context, &$data)
{
    if ($context !== 'com_menus.item')
    {
        return true;
    }
        $data['title'] = 'My custom title';
}

Then go to menu manager and try make new menu item.

expected result
you get predefined title "My custom title"

actual result
nothing changed

avatar Fedik Fedik - open - 17 May 2015
avatar Bakual
Bakual - comment - 17 May 2015

The only plugin we have in core which uses that event is the user profile one. And the call for that is indeed by reference like suggested here.

I did a short search and found 6 other places where this call is made. So my request would be that you change them as well so it's consistent across all instances.

avatar Fedik
Fedik - comment - 17 May 2015

After quick check Content, User, Banners, Categories: $data is JObject - so there all good,
and in MenuItem: $data is array - that where I got a problem

@Bakual sorry, I not very understand why need to changes something in other places as JModelForm::preprocessData is the one place where event onContentPrepareData actually called :wink:

avatar Bakual
Bakual - comment - 17 May 2015

Ah true, I didn't check the data type. If they're an object, then they're passed by reference anyway and thus it's fine indeed. Sorry for the confusion then. :)

avatar zero-24 zero-24 - change - 17 May 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 17 May 2015
Category Libraries Plugins
avatar zero-24 zero-24 - change - 17 May 2015
Status New Pending
Easy No Yes
avatar zero-24 zero-24 - change - 18 May 2015
Milestone Added:
avatar zero-24 zero-24 - change - 20 May 2015
Milestone Removed:
avatar zero-24 zero-24 - change - 15 Jun 2015
Milestone Added:
avatar smz
smz - comment - 19 Jun 2015

Sorry guys, but shouldn't this have a "Re-evaluate for v4.0" label more than a "Joomla 4.0" milestone?

avatar Bakual
Bakual - comment - 19 Jun 2015

The milestone is just a test for the referenced Issue in JIssues.

This one should be fine to be merged into 3.4.2 or 3.5.0. If it gets any tests at all.

avatar zero-24 zero-24 - change - 19 Jun 2015
Milestone Removed:
avatar zero-24
zero-24 - comment - 19 Jun 2015

Sorry @smz . @Bakual is correct the "Joomla 4.0" milestone was for testing a bug in jissues. I have removed it now :smile:

avatar smz
smz - comment - 19 Jun 2015

Ah, ok! No problem, @zero-24! I was wondering why this couldn't go in Joomla! 3.... :smile:
Will test it later today....

avatar Bloggerschmidt
Bloggerschmidt - comment - 24 Oct 2015

Test it and works like described.

avatar Bakual Bakual - change - 24 Oct 2015
Milestone Added:
avatar dgt41 dgt41 - test_item - 24 Oct 2015 - Tested successfully
avatar dgt41
dgt41 - comment - 24 Oct 2015

I have tested this item :white_check_mark: successfully on 0188a81


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6968.

avatar dgt41 dgt41 - change - 24 Oct 2015
Status Pending Ready to Commit
avatar matrikular matrikular - test_item - 24 Oct 2015 - Tested successfully
avatar matrikular
matrikular - comment - 24 Oct 2015

I have tested this item :white_check_mark: successfully on 0188a81

Patch solves issue.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6968.

avatar joomla-cms-bot joomla-cms-bot - change - 24 Oct 2015
Labels Added: ?
avatar Kubik-Rubik
Kubik-Rubik - comment - 24 Oct 2015

Thank you @Fedik and testers! Merged.

avatar Kubik-Rubik Kubik-Rubik - change - 24 Oct 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-10-24 14:45:58
Closed_By Kubik-Rubik
avatar Kubik-Rubik Kubik-Rubik - close - 24 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - close - 24 Oct 2015
avatar Kubik-Rubik Kubik-Rubik - reference | d29c412 - 24 Oct 15
avatar Kubik-Rubik Kubik-Rubik - merge - 24 Oct 2015
avatar Kubik-Rubik Kubik-Rubik - close - 24 Oct 2015
avatar joomla-cms-bot joomla-cms-bot - change - 24 Oct 2015
Labels Removed: ?
avatar Fedik Fedik - head_ref_deleted - 24 Oct 2015
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone Added:
avatar zero-24 zero-24 - change - 28 Oct 2015
Milestone

Add a Comment

Login with GitHub to post a comment