Undefined offset error and fix.

Phoca Download - download manager
skleronom
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 05 Jun 2015, 12:50

Undefined offset error and fix.

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Undefined offset error and fix.

Post by Jan »

Hi, which version of Phoca Download you are running?

Jan
If you find Phoca extensions useful, please support the project
grubosoft
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 19 Jun 2015, 17:47

Re: Undefined offset error and fix.

Post by grubosoft »

Jan, i got the same error as mentioned by skleronom. I'm using version 3.0.6 with joomla 3.4.1
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Undefined offset error and fix.

Post by Jan »

Hi, hmm, can I see the site where this occurs?

Jan
If you find Phoca extensions useful, please support the project
skleronom
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 05 Jun 2015, 12:50

Re: Undefined offset error and fix.

Post 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
Last edited by skleronom on 15 Jul 2015, 15:34, edited 1 time in total.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Undefined offset error and fix.

Post 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
If you find Phoca extensions useful, please support the project
skleronom
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 05 Jun 2015, 12:50

Re: Undefined offset error and fix.

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Undefined offset error and fix.

Post by Jan »

Hi, did you create a menu link to Phoca Download?

Jan
If you find Phoca extensions useful, please support the project
skleronom
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 05 Jun 2015, 12:50

Re: Undefined offset error and fix.

Post 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!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48566
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Undefined offset error and fix.

Post 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
If you find Phoca extensions useful, please support the project
Post Reply