? Success

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
3 Apr 2014

When ajax ordering Plugins, Modules, Content languages, we get a Notice in the php logs.
[03-Apr-2014 08:42:58 UTC] PHP Notice: Trying to get property of non-object in ROOT/libraries/legacy/model/admin.php on line 1143

It does not prevent the ordering from working fine.

This looks like coming from the fact that these tables are not concerned by content_types and therefore can't have a value for $type->type_alias

Here is a patch

avatar infograf768 infograf768 - open - 3 Apr 2014
avatar wilsonge
wilsonge - comment - 4 Apr 2014

As the only place typeAlias is being used is in the tags area https://github.com/infograf768/joomla-cms/blob/orderingnotice/libraries/legacy/model/admin.php#L1178 So rather than setting a $typeAlias for all scenario's - surely it would be better to move this if statement to cover the createTagsHelper function

avatar infograf768
infograf768 - comment - 4 Apr 2014

@wilsonge
In the meanwhile, I updated PR as suggested by @elkuku

avatar infograf768
infograf768 - comment - 4 Apr 2014

In fact the issue is indeed also for each batch functions, each time for createTagsHelper, $tagsobserver, etc.

avatar infograf768
infograf768 - comment - 4 Apr 2014

Please wait for testing. Thomas is working on a global pr for all these issues.

avatar Bakual
Bakual - comment - 4 Apr 2014

@infograf768 second PR done against your branch,

  • Changing if (!this->batchSet) to if (empty($this->batchSet)) so we don't get any notice if the property isn't set
  • Wrapping the createTagsHelper into a conditional which checks for !empty($this->type)
  • reverting my stupid moving the tag stuff into the foreach.
avatar wilsonge
wilsonge - comment - 4 Apr 2014

That looks much better :)

avatar infograf768
infograf768 - comment - 4 Apr 2014

Before I merge, need to know if we keep static.
See infograf768#9

avatar infograf768
infograf768 - comment - 4 Apr 2014

Looks OK now, need testers and comments on joomlacode. Thanks

avatar roland-d
roland-d - comment - 6 Apr 2014

test: The notice from the PHP error log is gone after applying the fix. Ordering still works as expected.

avatar wilsonge
wilsonge - comment - 8 Apr 2014

test. notice in my php error log stops appearing on reordering in module manager. But ordering still works. Code also looks good :)

avatar infograf768 infograf768 - change - 8 Apr 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-04-08 13:43:52
avatar infograf768 infograf768 - close - 8 Apr 2014
avatar infograf768 infograf768 - close - 8 Apr 2014
avatar infograf768 infograf768 - head_ref_deleted - 8 Apr 2014
avatar Bakual Bakual - reference | 529ce00 - 12 May 14

Add a Comment

Login with GitHub to post a comment