Page 1 of 1

admirorgallery.php error

Posted: Thu Feb 27, 2014 11:07 pm
by philadler
Hi all just upgraded to joomla 3.2.2 and gallery 5.0 my other galleries seem to be working properly but i am getting this error in one of my modules.

Notice: Undefined property: stdClass::$id in /home/bluegreyarmy/public_html/new/plugins/content/admirorgallery/admirorgallery.php on line 68

line 68 of that file is:

Code: Select all

$AG->articleID = $row->id;
any idea why this is only happening in this module and not any of my articles?

Thanks,

Phil

Re: admirorgallery.php error

Posted: Sat Mar 01, 2014 2:39 am
by Vasiljevski
The module doesn't provide $row->id;.

You see when you use gallery in the article $row is actually and article object and it has it's ID ($row->id;)
In module case, $row is some other object (wonderful Joomla, doing things wrong) thus you get the error :)

One fix would be to ad a check:

Code: Select all

if(isset($row->id))
{ $AG->articleID = $row->id;}
else
{$AG->articleID = 0;}
It will remove the notice. Also if you know what could be used as unique id in module case, please let me know. :)

Re: admirorgallery.php error

Posted: Tue Mar 04, 2014 4:25 pm
by philadler
I added the code you posted and I am still getting the same error message. Please advise

Re: admirorgallery.php error

Posted: Tue Mar 11, 2014 3:38 pm
by philadler
Do you have another suggestion for this? The code you provided did not remove the error.

Thanks

Phil

Re: admirorgallery.php error

Posted: Wed Mar 12, 2014 12:43 pm
by Vasiljevski
Can you post your file so I could check?

In the meantime, remove that part of code and just set :

Code: Select all

$AG->articleID = 0;
This must remove the notice :)

Re: admirorgallery.php error

Posted: Thu Mar 13, 2014 7:47 pm
by philadler
well i thought i posted the file but i guess i forgot so here it is

Re: admirorgallery.php error

Posted: Fri Mar 14, 2014 11:47 pm
by Vasiljevski
Are you sure that you receive the same error again?

I just checked with original admirorgallery.php and I can see the error:
Notice: Undefined property: stdClass::$id in /opt/lampp/htdocs/joomla323/plugins/content/admirorgallery/admirorgallery.php on line 69

When I used the file you sent, there is no Notice. So you did add the fix correctly.

Can you please check again?

Re: admirorgallery.php error

Posted: Sat Mar 15, 2014 2:44 am
by philadler
I will try it again I see your error was on line 69 and mine was line 68. I will let you know the results

Re: admirorgallery.php error

Posted: Sat Mar 15, 2014 5:03 pm
by Vasiljevski
It is the same code, I just added a debug print so the line was pushed to 69 :)

Re: admirorgallery.php error

Posted: Mon Mar 17, 2014 2:56 pm
by philadler
I re-uploaded the file and the error is gone. Not sure what I did wrong the first time.

Thanks For the Awesome Support!!!!