Errors: "Undefined offset: -1" and "404 -Resource not found"
Posted: 29 Sep 2009, 00:48
I'm trying to get Phoca Gallery to work for the first time, so maybe I'm missing a part of the installation. (From the documentation it's not quite clear what is required, since each module/plugin is separate). I have managed to upload images and created a single test category. Using the Phoca button plugin I can create a gallery of thumbnails on a page. However, clicking any thumbnail displays a pop-up with the following message:
This is followed by a "404 - Resource not found" error.
This does not seem to be related to this problem: viewtopic.php?f=1&t=5205&start=0 since it's the first time I've ever downloaded and installed Phoca.
Looking at the error message and the relevant php code, the line in question is:
So it appears that the expression $count - 4 evaluates to -1, which is not a valid array index. And sure enough, when I change that line and hard-code my category id instead of the expression, that error disappears:
So this might be a bug in Phoca: the expression evaluates to an invalid array index, but the script in router.php does not check for that possibility.
However, even when I apply my "fix", I still get the 404 error. I've been trying various combinations of settings, from the simplest
{phocagallery view=category|categoryid=1}
to more complex ones as shown in the examples. I'm using the button plugin, so it should not be creating invalid code. The error happens also with default Joomla 1.5 template.
I'll appreciate any help! Phoca is my only chance to show images, since no other gallery I've tried, including a commercial product, can even generate thumbnails for png files.
(I've tried to upload a screenshot, but the forum engine gives an error. You can see it here: http://ethervane.com/images/stories/phoca-error.png )
On edit: I've figured out that disabling SEF URLs fixes the problem, but this is not an acceptable solution. Does the gallery not work with "pretty" URLs?
Code: Select all
Notice: Undefined offset: -1 in C:\srv\root\joomlartmoxybare\components\com_phocagallery\router.php on line 230This does not seem to be related to this problem: viewtopic.php?f=1&t=5205&start=0 since it's the first time I've ever downloaded and installed Phoca.
Looking at the error message and the relevant php code, the line in question is:
Code: Select all
$vars['catid'] = $segments[$count - 4];Code: Select all
$vars['catid'] = 1;However, even when I apply my "fix", I still get the 404 error. I've been trying various combinations of settings, from the simplest
{phocagallery view=category|categoryid=1}
to more complex ones as shown in the examples. I'm using the button plugin, so it should not be creating invalid code. The error happens also with default Joomla 1.5 template.
I'll appreciate any help! Phoca is my only chance to show images, since no other gallery I've tried, including a commercial product, can even generate thumbnails for png files.
(I've tried to upload a screenshot, but the forum engine gives an error. You can see it here: http://ethervane.com/images/stories/phoca-error.png )
On edit: I've figured out that disabling SEF URLs fixes the problem, but this is not an acceptable solution. Does the gallery not work with "pretty" URLs?