? Success

User tests: Successful: Unsuccessful:

avatar radiant-tech
radiant-tech
20 Feb 2014

As reported in Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33314

$originalOrders var is only set if Tags exist -- moved $originalOrders = array() to earlier in code where other fields are initialized.

avatar radiant-tech radiant-tech - open - 20 Feb 2014
avatar Bakual
Bakual - comment - 20 Feb 2014

I wonder if this is even used for anything. Looks to me like it is set as an empty array in the view and will never be populated with a value. Most likely it's leftover code which could be removed safely.

avatar radiant-tech
radiant-tech - comment - 20 Feb 2014

Good point. I hadn't looked to see if/where it was used. Confirmed it is not referenced anywhere else in com_tags. Updated the PR to remove the 2 lines using it.

avatar phproberto
phproberto - comment - 20 Feb 2014

This comes from the old ordering system. I think we can remove it from everywhere and also clean saveOrder from controllers because now saveOrderAjax calls itself to models.

avatar radiant-tech
radiant-tech - comment - 20 Feb 2014

Thanks Roberto. I was just looking at that. This older version is still used in Tags, Menus and Categories. I will update this to remove $originalOrders from the views of all 3 as well as removing saveorder() from their controllers.

avatar Bakual
Bakual - comment - 20 Feb 2014

Have a look at hathor overrides as well. I think I saw that there was some value saved in that for categories and menus. It's likely that it can be removed as well.

avatar radiant-tech
radiant-tech - comment - 20 Feb 2014

@phproberto - Does this mean we can remove the Joomla.orderTable function in the view files also?

avatar Bakual
Bakual - comment - 21 Feb 2014

@radiant-tech @phproberto It may be wise to not remove saveOrder but deprecate it instead. You never know if a crazy developer used it somewhere.

avatar wilsonge
wilsonge - comment - 21 Feb 2014

I wouldn't call it that crazy. I think quite a few people aren't happy with the AJAX ordering so have stuck with the 2.5 system. Definitely don't think we should remove it

avatar radiant-tech
radiant-tech - comment - 21 Feb 2014

saveorder() in the Categories and Menu Items controllers just checks whether any ordering has changed (the originalOrders var in the view file and passed through post as 'original_order_values') and then passes control to saveorder() in JControllerAdmin.

Removing it from these components just takes out that extra step, so no harm, right?

avatar Bakual
Bakual - comment - 21 Feb 2014

It's a public function which can in theory be used by other extensions. Also other extensions may have extended this class for whatever reasons.
Leave the function there, but mark it as deprecated and log the usage using JLog.
Since it isn't used anymore by the core extensions itself, it will be just a bit of code which is there. We will remove it with 4.0.

avatar infazse
infazse - comment - 8 Apr 2014

Hi Denise,
The problem comes when there are no tags in the CMS means if you haven't created any tags before and you are trying to create it for the first time it comes up. So at the line 235 when you try to echo $orignal orders if you can check whether the variable is not null which is the array, it works fine. So we aren't removing $originalOrders variable but just handling it in the echo statement checking whether the variable is null.

avatar radiant-tech
radiant-tech - comment - 8 Apr 2014

@infazse - Understood. The point is that the $originalOrders variable is old code and no longer necessary. This PR is intended to clean that up AND fix the undefined error.

avatar infazse
infazse - comment - 8 Apr 2014

Oh i see. Thanks will do some testing on the Pull request.

avatar javigomez
javigomez - comment - 16 Apr 2014

Tested. The patch fixes the issue.

See testing instructions at #3455

avatar Kubik-Rubik
Kubik-Rubik - comment - 17 Apr 2014

Tested successfully.

Thanks!

avatar Bakual Bakual - change - 17 Apr 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-04-17 12:58:34
avatar Bakual Bakual - change - 17 Apr 2014
Title
fix $originalOrders undefined var
[#33314] fix $originalOrders undefined var
avatar Bakual Bakual - close - 17 Apr 2014
avatar Bakual Bakual - close - 17 Apr 2014
avatar radiant-tech radiant-tech - change - 17 Apr 2014
Title
fix $originalOrders undefined var
[#33314] fix $originalOrders undefined var
avatar wilsonge wilsonge - reference | 0cfc0ea - 23 Apr 14
avatar Bakual Bakual - reference | f1ed7aa - 12 May 14
avatar Kubik-Rubik Kubik-Rubik - reference | 5908445 - 4 Jun 14

Add a Comment

Login with GitHub to post a comment