Page 1 of 1

Category Sorting doesn't work

Posted: 22 Nov 2018, 17:17
by iamalive
Hi Jan

I'm using this Gallery on a site - everything works as expected, but for one issue:
I can't sort categories in the backend. Whatever I select, nothing happens.
I'm talking about the sort function marked in red on the image (see link below).
[url]https://langnau.imaufbau.ch/images/phoc ... ANGES1.jpg[/url]

All Software is the latest Version and it's on PHP 7.2

Hope you can help

All the best
David

Re: Category Sorting doesn't work

Posted: 23 Nov 2018, 11:08
by Jan
Hi, when you enable javascript console to debug, do you get any javascript error on the site?

https://www.phoca.cz/documents/16-jooml ... -conflicts

EDIT: confirmed.

Please, try to open this file:

administrator\components\com_phocagallery\libraries\phocagallery\render\renderadminviews.php

and at the bottom, uncomment lines in the first function.

FROM:

Code: Select all

public function jsJorderTable($listOrder) {
		/*return '<script type="text/javascript">' . "\n"
		.'Joomla.orderTable = function() {' . "\n"
		.'  table = document.getElementById("sortTable");' . "\n"
		.'  direction = document.getElementById("directionTable");' . "\n"
		.'  order = table.options[table.selectedIndex].value;' . "\n"
		.'  if (order != \''. $listOrder.'\') {' . "\n"
		.'    dirn = \'asc\';' . "\n"
		.'	} else {' . "\n"
		.'    dirn = direction.options[direction.selectedIndex].value;' . "\n"
		.'  }' . "\n"
		.'  Joomla.tableOrdering(order, dirn, \'\');' . "\n"
		.'}' . "\n"
		.'</script>' . "\n";
		return "";*/
	}
TO:

Code: Select all

public function jsJorderTable($listOrder) {
		return '<script type="text/javascript">' . "\n"
		.'Joomla.orderTable = function() {' . "\n"
		.'  table = document.getElementById("sortTable");' . "\n"
		.'  direction = document.getElementById("directionTable");' . "\n"
		.'  order = table.options[table.selectedIndex].value;' . "\n"
		.'  if (order != \''. $listOrder.'\') {' . "\n"
		.'    dirn = \'asc\';' . "\n"
		.'	} else {' . "\n"
		.'    dirn = direction.options[direction.selectedIndex].value;' . "\n"
		.'  }' . "\n"
		.'  Joomla.tableOrdering(order, dirn, \'\');' . "\n"
		.'}' . "\n"
		.'</script>' . "\n";
		return "";
	}
and let me know if this works.

Thank you, Jan

Re: Category Sorting doesn't work

Posted: 23 Nov 2018, 11:37
by iamalive
Thanks, Jan

Tried that, but all I got was;

An error has occurred.
0 syntax error, unexpected '*'
and a white page :-(

Re: Category Sorting doesn't work

Posted: 23 Nov 2018, 14:49
by Jan
Hi, this is a php error which means that there is some syntax error. Did you copy the whole function. When you enable php error reporting, you wil get info about the file and row where the syntax error occurs.

Jan

Re: Category Sorting doesn't work

Posted: 23 Nov 2018, 15:06
by iamalive
Hi again Jan

Thanks! I only removed the comment. This time I copied the whole section and replaced it: it works!

As always appreciate your help.

Best regards
David

Re: Category Sorting doesn't work

Posted: 24 Nov 2018, 20:52
by Jan
Ok, great to hear it.

Jan

Re: Category Sorting doesn't work

Posted: 28 Jan 2019, 16:06
by Jan
Hi, should be OK in version 4.3.11
https://www.phoca.cz/news/1003-phoca-ga ... 1-released

Jan

Re: Category Sorting doesn't work

Posted: 28 Jan 2019, 19:50
by iamalive
Terrific! Thanks Jan. Much appreciated.
Regards
David

Re: Category Sorting doesn't work

Posted: 29 Jan 2019, 00:23
by Jan
Ok