? ? Pending

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
18 Apr 2017

Summary of Changes

Just a small code improvement: Use foreach instead of a complex for loop (so we always use the correct key)

Testing Instructions

The backend articles view should work exactly the same before and after the patch

avatar bembelimen bembelimen - open - 18 Apr 2017
avatar bembelimen bembelimen - change - 18 Apr 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Apr 2017
Category Administration com_content
avatar franz-wohlkoenig franz-wohlkoenig - test_item - 18 Apr 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 18 Apr 2017

I have tested this item successfully on bab4950


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 18 Apr 2017
Easy No Yes
avatar rdeutz rdeutz - test_item - 18 Apr 2017 - Tested unsuccessfully
avatar rdeutz
rdeutz - comment - 18 Apr 2017

I have tested this item ? unsuccessfully on bab4950

That will not work and is not a really good change:

  1. foreach makes a copy of the array so after the change we will use more memory
  2. because foreach makes a copy unset has not effect on the original array
    This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15363.
avatar Bakual
Bakual - comment - 18 Apr 2017

foreach ($items as $x => &$item) should solve the issue with the copy (from memory, not tested).

avatar bembelimen
bembelimen - comment - 18 Apr 2017

I did not change the unset line. It is still executed on the original variable, so no need for a reference...

avatar bembelimen
bembelimen - comment - 18 Apr 2017

Additional now we are sure, that the key is the correct one. In the old version we guessed the key

avatar rdeutz
rdeutz - comment - 18 Apr 2017

ah now I see what you are doing, but then I would do it different

foreach (array_keys($items) as $key) ....

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 May 2017

@bembelimen how to go on with this PR?


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

avatar bembelimen bembelimen - change - 2 Jun 2017
Labels Added: ?
avatar bembelimen
bembelimen - comment - 2 Jun 2017

Updated

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 Jun 2017

I have tested this item successfully on 8a4b5ee


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

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 2 Jun 2017 - Tested successfully
avatar coolcat-creations
coolcat-creations - comment - 3 Jun 2017

I have tested this item successfully on 8a4b5ee


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

avatar coolcat-creations coolcat-creations - test_item - 3 Jun 2017 - Tested successfully
avatar franz-wohlkoenig franz-wohlkoenig - change - 3 Jun 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 3 Jun 2017

RTC after two successful tests.

avatar rdeutz rdeutz - change - 8 Jun 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-06-08 06:49:38
Closed_By rdeutz
Labels Added: ?
avatar rdeutz rdeutz - close - 8 Jun 2017
avatar rdeutz rdeutz - merge - 8 Jun 2017

Add a Comment

Login with GitHub to post a comment