joomla-projects / com_localise

forked version of the original com_localise for experimental purposes
GNU General Public License v2.0
24 stars 36 forks source link

Sorting broken in Translations view #294

Closed infograf768 closed 8 years ago

infograf768 commented 8 years ago

As title says, there is no change when switching from ascending to descending.

Valc commented 8 years ago

Seems It is due the filter never is sending an '1': it is sending an "asc", "desc" or an empty value: At ../models/translations.php we have:

            $direction = -1;

            if ($this->getState('list.direction'))
            {
                $direction = 1;
            }

Replaced by this one the stuff seems is working:

            if ($this->getState('list.direction') == "asc" || $this->getState('list.direction') == "")
            {
                $direction = 1;
            }
            else
            {
                $direction = -1;
            }

But if the idea is get 1 or -1 values is required search where the "desc" or "asc" are inserted (no idea in this moment).

One time solved there seem that the original code will be working right.

Regards.

infograf768 commented 8 years ago

I have another solution, implementing at the same time searchtools. :smiley: Will post here when I have a PR.

Valc commented 8 years ago

Great :smiley:

infograf768 commented 8 years ago

Please test https://github.com/joomla-projects/com_localise/pull/295

infograf768 commented 8 years ago

Closing as we have a patch