Category Sorting doesn't work

Phoca Gallery - image gallery extension
iamalive
Phoca Enthusiast
Phoca Enthusiast
Posts: 55
Joined: 07 Dec 2007, 15:52
Contact:

Category Sorting doesn't work

Post 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

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category Sorting doesn't work

Post 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
If you find Phoca extensions useful, please support the project
iamalive
Phoca Enthusiast
Phoca Enthusiast
Posts: 55
Joined: 07 Dec 2007, 15:52
Contact:

Re: Category Sorting doesn't work

Post by iamalive »

Thanks, Jan

Tried that, but all I got was;

An error has occurred.
0 syntax error, unexpected '*'
and a white page :-(
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category Sorting doesn't work

Post 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
If you find Phoca extensions useful, please support the project
iamalive
Phoca Enthusiast
Phoca Enthusiast
Posts: 55
Joined: 07 Dec 2007, 15:52
Contact:

Re: Category Sorting doesn't work

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category Sorting doesn't work

Post by Jan »

Ok, great to hear it.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category Sorting doesn't work

Post by Jan »

Hi, should be OK in version 4.3.11
https://www.phoca.cz/news/1003-phoca-ga ... 1-released

Jan
If you find Phoca extensions useful, please support the project
iamalive
Phoca Enthusiast
Phoca Enthusiast
Posts: 55
Joined: 07 Dec 2007, 15:52
Contact:

Re: Category Sorting doesn't work

Post by iamalive »

Terrific! Thanks Jan. Much appreciated.
Regards
David
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47870
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Category Sorting doesn't work

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply