Page 1 of 2

Error 500 on categtories view

Posted: 16 Mar 2015, 12:32
by Drexel
Hello everybody,

I have a problem with the categories view. When i configure a menu item with the categories view I get the following error: 500 - Layout „default_noimg“ not found!.

The URL looks like index.php?option=com_phocagallery&view=categories&Itemid=193

The category view with an URL like index.php?option=com_phocagallery&view=category&id=1&Itemid=193 works fine.

Do you have any idea where the problem might be?

Thank you in advance!

Re: Error 500 on categtories view

Posted: 21 Mar 2015, 19:03
by Jan
Hi, try to check the Options of Phoca Gallery, see the "Categories View" part and try to set the options to default - check the legacy options too.

Does anybody do modifications to the code?

Jan

Re: Error 500 on categtories view

Posted: 02 May 2015, 14:00
by Drexel
Hi.

Sorry I haven't noticed your answer yet, because I didn't find the time yet to solve the problem, but now I did. I checked and tried also your mentioned options, but I never changed something there. And it also made no difference.

I debugged the problem and found 2 errors. I wonder that these errors are so obvious. If these really exist in that way, I can't imagine no one else has the problems. I suspected some kind of version mismatch due to a failed update, but I checked the files from the installer package, they seem to be correct.

So first problem:
File templates\my_template\html\com_phocagallery\categories\default.php
Original code line 35+

Code: Select all

if ($this->tmpl['displayimagecategories'] == 1) {
	echo $this->loadTemplate('catimg');// TABLE LAYOUT - Categories and Images
} else if ($this->tmpl['displayimagecategories'] == 2){
	echo $this->loadTemplate('catimgdetail');// DETAIL LAYOUT 2 (with columns)
} else if ($this->tmpl['displayimagecategories'] == 3){
	echo $this->loadTemplate('catimgdetailfloat');// DETAIL LAYOUT 3 - FLOAT - Every categoy will float Categories, images and detail information (Float)
} else if ($this->tmpl['displayimagecategories'] == 4){
	echo $this->loadTemplate('catimgdesc');// LAYOUT 4 (with columns) (easy categories, images and description)
} else if ($this->tmpl['displayimagecategories'] == 5){
	echo $this->loadTemplate('custom');// LAYOUT 5 Custom - float
} else {
	echo $this->loadTemplate('noimg');// UL LAYOUT - Categories Without Images
}
The code checks for a property $this->tmpl['displayimagecategories'] but in the object the property name is $this->tmpl['display_image_categories']

So i corrected the code

Code: Select all

if ($this->tmpl['display_image_categories'] == 1) {
	echo $this->loadTemplate('catimg');// TABLE LAYOUT - Categories and Images
} else if ($this->tmpl['display_image_categories'] == 2){
	echo $this->loadTemplate('catimgdetail');// DETAIL LAYOUT 2 (with columns)
} else if ($this->tmpl['display_image_categories'] == 3){
	echo $this->loadTemplate('catimgdetailfloat');// DETAIL LAYOUT 3 - FLOAT - Every categoy will float Categories, images and detail information (Float)
} else if ($this->tmpl['display_image_categories'] == 4){
	echo $this->loadTemplate('catimgdesc');// LAYOUT 4 (with columns) (easy categories, images and description)
} else if ($this->tmpl['display_image_categories'] == 5){
	echo $this->loadTemplate('custom');// LAYOUT 5 Custom - float
} else {
	echo $this->loadTemplate('noimg');// UL LAYOUT - Categories Without Images
}

Re: Error 500 on categtories view

Posted: 02 May 2015, 15:31
by Drexel
Second problem:

In file libraries\legacy\view\legacy.php the template engine searches for a file 'default_catimg.php' on line 647/650 in the template folder and in the component folder. I guess it shall be located in the component folder under components\com_phocagallery\views\categories\tmpl, but there is no such file, there is only a file 'default_obscatimg.php'. When I rename the file to 'default_catimg.php' it works.

Hope this helps for further analysis, if this is a common problem.

Re: Error 500 on categtories view

Posted: 02 May 2015, 16:02
by Jan
Hi, the "default_obscatimg.php" is called when it is set in options.

The libraries\legacy\view\legacy.php is helper class, not ouput so it is located in libraries folder.


Jan

Re: Error 500 on categtories view

Posted: 03 May 2015, 14:58
by Drexel
Hi!

Which option do you mean? Categories View - Legacy Settings->Displaying Style? No matter what I set up there, it is always looking for the files without 'obs' in the name... And when I set it to 'Not used' it looks for default_catimg.php....

Re: Error 500 on categtories view

Posted: 07 May 2015, 11:15
by Jan
Hi, see the code in default.php:

Code: Select all

switch($this->tmpl['display_image_categories']) {

    case 0:
        echo $this->loadTemplate('obs_catimgdetailtitleonly');
    break;
    
    case 2:
        echo $this->loadTemplate('obs_catimgdetail');
    break;
    
    case 3:
        echo $this->loadTemplate('obs_catimgdetailfloat');
    break;
    
    case 4:
        echo $this->loadTemplate('obs_catimgdesc');
    break;
    
    case 5:
        echo $this->loadTemplate('obs_custom');
    break;
    
    case 1:
    default:
        echo $this->loadTemplate('categories');
    break;
}
This means that methods:

Code: Select all

<field name="display_image_categories" type="list" default="1" label="COM_PHOCAGALLERY_FIELD_DISPLAY_CATEGORIES_STYLE_LABEL" description="COM_PHOCAGALLERY_FIELD_DISPLAY_CATEGORIES_STYLE_DESC">
	<option value="1">COM_PHOCAGALLERY_CATEGORIES_NOT_USED</option>
	<option value="0">COM_PHOCAGALLERY_CATEGORIES_WITHOUT_IMAGES</option>
	<option value="2">COM_PHOCAGALLERY_CATEGORIES_IMAGES_AND_DETAIL_INFORMATION</option>
	<option value="3">COM_PHOCAGALLERY_CATEGORIES_IMAGES_AND_DETAIL_INFORMATION_FLOAT</option>
	<option value="4">COM_PHOCAGALLERY_CATEGORIES_IMAGES_AND_DESCRIPTION_FLOAT</option>
	<option value="5">COM_PHOCAGALLERY_CATEGORIES_CUSTOM</option>
</field>
0,2,3,4,5 load "obs" views.

The parameter is called:

Displaying Style

Code: Select all

COM_PHOCAGALLERY_FIELD_DISPLAY_CATEGORIES_STYLE_DESC="Set style of displaying list of categories"
COM_PHOCAGALLERY_FIELD_DISPLAY_CATEGORIES_STYLE_LABEL="Displaying Style"

EDIT:

But looking at your code, seems like we are speaking about different versions of Phoca Gallery? Are you using the latest version 4.1.2?

Re: Error 500 on categtories view

Posted: 25 May 2015, 20:16
by Drexel
Yes, it's definitley 4.1.2, I checked it.

And I tried these options, they don't load the obs files. I wonder why I have the wrong code. :)

Re: Error 500 on categtories view

Posted: 31 May 2015, 23:06
by Jan
Hmm, really no idea, did you try to reinstall the gallery?

Jan

Re: Error 500 on categtories view

Posted: 20 Jun 2015, 11:59
by vanaveno
I have a same problem 500 - Layout default_noimg not found. I'am using joomla 3.4.1 and PG 4.1.2. How to fix this issues?
Thanks Vana