PhocaGallery Styling bug - I have the solution

Phoca Gallery - image gallery extension
wolvyreen
Phoca Member
Phoca Member
Posts: 13
Joined: 18 May 2016, 14:41

PhocaGallery Styling bug - I have the solution

Post by wolvyreen »

Hi,

I was trying to style my gallery and came across the following bug.

#pg-msnr-container id is always applied ONLY after changing the 'Phoca Gallery Center' parameter under 'General Settings' to anything.

The reason for this is because by default, the value of this parameter is equal to nothing upon first install. So it wont be applied after first install bu only once changing the 'Phoca Gallery Center' parameter to yes or no, it sets it to 1 or 0 for yes or no in the database. However, the code in the following files executes an if statement based on something or nothing which is wrong. The if statement needs to be based on 0 or 1 and the default value in the database should be set to 0 upon first install.

Files where the bug exists:

Code: Select all

components/com_phocagallery/views/category/view.html.php
components/com_phocagallery/views/categories/view.html.php
This is where the bug is:

Code: Select all

if ($this->tmpl['phocagallery_center'] != '') { 
	$s = "\n" . '#pg-msnr-container {'."\n";
	$s .= '   margin: 0 auto;'."\n";
	$s .= '}'."\n";
}
It should be a 0 or 1 condition check like the below:

Code: Select all

if ($this->tmpl['phocagallery_center'] != 0) { 
	$s = "\n" . '#pg-msnr-container {'."\n";
	$s .= '   margin: 0 auto;'."\n";
	$s .= '}'."\n";
}
I hope this will be patched.

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

Re: PhocaGallery Styling bug - I have the solution

Post by Jan »

Hi, thank you for the info. I will change it for the next release.

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

Re: PhocaGallery Styling bug - I have the solution

Post by Jan »

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