Page 1 of 2

Undefined offset error and fix.

Posted: 05 Jun 2015, 12:56
by skleronom
Hey I got this error message.
Notice: Undefined offset: -1 in [...]/Joomla/components/com_phocadownload/views/category/view.html.php on line 286
Since I didn't find a github repository or something alike I thought I put the fix here. There is probably a better way to do it, but I barely know anything about how Joomla works...

I replaced line 286 and line 294 of the file mentioned in the error message with:

Code: Select all

if(count($curpath)>0 && $this->category[0]->parenttitle != $curpath[count($curpath)-1]){
Cheers.

Re: Undefined offset error and fix.

Posted: 10 Jun 2015, 00:57
by Jan
Hi, which version of Phoca Download you are running?

Jan

Re: Undefined offset error and fix.

Posted: 19 Jun 2015, 17:54
by grubosoft
Jan, i got the same error as mentioned by skleronom. I'm using version 3.0.6 with joomla 3.4.1

Re: Undefined offset error and fix.

Posted: 22 Jun 2015, 18:54
by Jan
Hi, hmm, can I see the site where this occurs?

Jan

Re: Undefined offset error and fix.

Posted: 01 Jul 2015, 13:42
by skleronom
Hey,

Sorry for not replying.
It would occur here without my fix:
snip

I actually get a second error message on the bottom:

Code: Select all

 Notice: Undefined index: dg in [ommited]/html/Joomla/components/com_phocadownload/views/category/tmpl/default.php on line 125
I run 3.0.6 with Joomla 3.4.1.

Thanks for all your work btw!

edit* edited out website

Re: Undefined offset error and fix.

Posted: 04 Jul 2015, 20:13
by Jan
Hi, this seems like the ZIP package is not correct. Did you download the version 3.0.6 on this site? Because 3.0.6 does include this variable. :idea:

Jan

Re: Undefined offset error and fix.

Posted: 07 Jul 2015, 14:16
by skleronom
I reinstalled it. Still get

Code: Select all

 Notice: Undefined offset: -1 in /.../html/Joomla/components/com_phocadownload/views/category/view.html.php on line 286

Code: Select all

count($curpath)
returns 0.

Re: Undefined offset error and fix.

Posted: 07 Jul 2015, 23:01
by Jan
Hi, did you create a menu link to Phoca Download?

Jan

Re: Undefined offset error and fix.

Posted: 10 Jul 2015, 15:33
by skleronom
Hi,

No there is no direct link in the menu to the category where this issue happens. It is linked in an article which that is accessed via the menu.

Category views that are linked in the menu do not have this issue. Also if I add a menu entry that links to the category view where the issue appears, the issue is resolved.

So I guess the error only occurs if there is no menu entry to the category view.

Cheers!

Re: Undefined offset error and fix.

Posted: 11 Jul 2015, 14:15
by Jan
Hi, try to create a menu link to Phoca Download, e.g. to categories view (it can be hidden), see why:
https://www.phoca.cz/documents/16-joomla ... -in-joomla

and let me know if this helped

Jan