Error loading category in frontend

Phoca Gallery - image gallery extension
diegobenincasa
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 19 Apr 2021, 21:55

Error loading category in frontend

Post by diegobenincasa »

Hi all.

I've downloaded and installed Phoca Gallery 4.4.2 (Joomla 3.9.26, PHP 7.3.27) with no problems. Created a category and loaded some photos just fine too. However, when I create a menu item to load that category, the page shows erros in layout and, most relevant, it shows the following message:

Code: Select all

Error 0
Call to a member function getPagesLinks() on null
Images from selected category are shown completely out of layout on top of the page, and clicking on any of them loads a new page with just the clicked photo.

I haven't installed anything or changed any settings in Joomla, so I'm clueless as the message is somewhat vague.

Relevant to say that creating a menu item to categories listing causes the same problem (page layout breaking/misloading and same error message), and no categories are listed.

Helps are appreciated.

Thanks in advance!
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9094
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Error loading category in frontend

Post by Benno »

Hi,
are you getting error messages in the JS console?
To rule out template problems, did you try to switch to the Joomla! standard template Protostar for testing?

Kind regards,
Benno
christine
Phoca Hero
Phoca Hero
Posts: 2723
Joined: 28 Nov 2010, 17:20

Re: Error loading category in frontend

Post by christine »

Hi,

at first step: Try to switch temporary to Standard Template (Protostar) if you get the same message.

Which template do you use - and/or could we see it somewhere?

Propably: Would be useful to enable debug mode and error reporting in Joomla! Configuration.
Error reporting to Maxium. Debug Settings: Yes. To get more information where this problem occurs. So called "Call Stack"

Kind regards
Christine

Edit: Hi Benno, I was too late :wink:
diegobenincasa
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 19 Apr 2021, 21:55

Re: Error loading category in frontend

Post by diegobenincasa »

Hello Benno and Christine, and thanks for the suggestions!

Changing to Protostar theme (and adjusting the menu item position, of course) makes Phoca Gallery work just fine, so I guess it is some sort of incompatibility with the template I'm using. It's a Brazilian Government standard template that can be found at https://github.com/joomlagovbr/joomla-3.x.

Checking the Edge console shows this, two times:

Code: Select all

Uncaught ReferenceError: jQuery is not defined
Reading the Joomla generated HTML page code, I presume that Phoca Gallery assumes jQuery is loaded somewhere else (because it doesn't load it by itself). Am I right to assume that the template should have loaded it and it is not doing so? If yes. where do I load jQuery, and how? I'm not really a "webdeveloper" (I'm more desktop-focused), so I have trouble debugging this... =D

Unfortunately, this site is for local access only and is not available through internet.

Thanks again!
christine
Phoca Hero
Phoca Hero
Posts: 2723
Joined: 28 Nov 2010, 17:20

Re: Error loading category in frontend

Post by christine »

Hi,
diegobenincasa wrote: 20 Apr 2021, 15:17 Changing to Protostar theme (and adjusting the menu item position, of course) makes Phoca Gallery work just fine, so I guess it is some sort of incompatibility with the template I'm using. It's a Brazilian Government standard template that can be found at https://github.com/joomlagovbr/joomla-3.x.
Maybe you could contact there the Template developer & ask about to update it. e.g.:
https://github.com/joomlagovbr/joomla-3 ... stract.php etc.
Checking the Edge console shows this, two times:

Code: Select all

Uncaught ReferenceError: jQuery is not defined
Am I right to assume that the template should have loaded it and it is not doing so? If yes. where do I load jQuery, and how?
Can give you only generell infos, maybe it helps:

Enter the template's index.php as early as possible, e.g. immediately after

defined ('_ JEXEC') or die;
the line

Code: Select all

JHtml::_('jquery.framework');
Then jquery should always be loaded in the HEAD block of the page. Or at the point where the line

<jdoc: include type = "head" />

stands (and it should be in the HEAD block).

Then check the source code in the browser to see if jquery appears anywhere else. That must not be.

Then check whether all scripts that JQuery need, are loaded BEHIND the loading lines inserted by Joomla.

Or: You could try to solve it with: jQuery Easy: https://extensions.joomla.org/extension/jquery-easy/ as we can't know about your template.

Kind regards
Christine
diegobenincasa
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 19 Apr 2021, 21:55

Re: Error loading category in frontend

Post by diegobenincasa »

Hello again, Christine!
Enter the template's index.php as early as possible, e.g. immediately after

defined ('_ JEXEC') or die;
the line

Code: Select all

JHtml::_('jquery.framework');
Then jquery should always be loaded in the HEAD block of the page. Or at the point where the line

<jdoc: include type = "head" />

stands (and it should be in the HEAD block).
Tried that. Not helping. Nothing changes.

I was able to repeat the behaviour in our website, so you could see the problem by yourself. Apparently the Phoca Gallery div's are loading first, way before the rest of the page.

Here's the link: http://www.1cgeo.eb.mil.br/museu

One thing I noticed is that jQuery IS "loaded" (even before the modification suggested by you). The "<script>" tag is there, but at the end of the page. Reading the template's code I found that it is designed to be that way. Is that a problem I may report to the developer?

Thanks again!
christine
Phoca Hero
Phoca Hero
Posts: 2723
Joined: 28 Nov 2010, 17:20

Re: Error loading category in frontend

Post by christine »

Hi,

Nevertheless I would contact the Template developer. You could also check all other extensions, such as K2 etc and to try jQuery Easy.

Your site takes a long time, until it's loaded.

In addition .../museu, I got:
The requested URL was rejected. Please consult with your administrator. Your support ID is: .........

Kind regards
Christine
diegobenincasa
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 19 Apr 2021, 21:55

Re: Error loading category in frontend

Post by diegobenincasa »

christine wrote: 20 Apr 2021, 19:19 Hi,

Nevertheless I would contact the Template developer. You could also check all other extensions, such as K2 etc and to try jQuery Easy.

Your site takes a long time, until it's loaded.

In addition .../museu, I got:
The requested URL was rejected. Please consult with your administrator. Your support ID is: .........

Kind regards
Christine
The error message while loading the page is solved. That's out of my control (I don't manage the webserver, just the site).

I'll give jQuery Easy a try. Already tried to contact the template developer, but he seems more lost than me! =D
He said that jQuery should work with the template, as other elements on the template relies on jQuery (e.g. the carousel on main page).

Thanks!
christine
Phoca Hero
Phoca Hero
Posts: 2723
Joined: 28 Nov 2010, 17:20

Re: Error loading category in frontend

Post by christine »

Hi,
diegobenincasa wrote: 20 Apr 2021, 19:53 The error message while loading the page is solved. That's out of my control (I don't manage the webserver, just the site).
Still get the error message.
I'll give jQuery Easy a try. Already tried to contact the template developer, but he seems more lost than me! =D
He said that jQuery should work with the template, as other elements on the template relies on jQuery (e.g. the carousel on main page).
Conclusion is, PG with Protostar, works.

You sent me the master of the Template: https://github.com/joomlagovbr/joomla-3 ... raries/fof

Found: https://www.phoca.cz/joomla/api/class-F ... tract.html

No more ideas at the moment.
Kind regards
Christine
Post Reply