It is currently Sun Dec 17, 2017 2:06 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Jan 09, 2015 5:06 pm 
Offline

Joined: Fri Jan 09, 2015 4:45 pm
Posts: 2
Hi,
if a menu structure was changed or article is available through the joola compontent (without a menu) a message is thrown:
[Fri Jan 09 14:42:01 2015] [error] [client 68.180.228.169] PHP Notice: Trying to get property of non-object in /var/www/cms/plugins/content/admirorgallery/admirorgallery/classes/agGallery.php on line 353
[Fri Jan 09 15:03:29 2015] [error] [client 212.186.180.210] PHP Notice: Trying to get property of non-object in /var/www/cms/plugins/content/admirorgallery/admirorgallery/classes/agGallery.php on line 353

At line 353, I changed it to:
Code:
// Breadcrump Support
         $active = JFactory::getApplication()->getMenu()->getActive();
         if (isset($active) && $active->query['view'] == 'layout')  $this->writeBreadcrum();


so only when menu item is not null and exists, the writeBreadcrum() is called;

Thomas

patch:
Code:
--- agGallery_orig.php   2015-01-09 15:04:25.000000000 +0100
+++ agGallery.php   2015-01-09 15:31:50.000000000 +0100
@@ -1,5 +1,6 @@
 <?php
  /*------------------------------------------------------------------------
+ LOYTEC patch 2015-01-09
 # admirorgallery - Admiror Gallery Plugin
 # ------------------------------------------------------------------------
 # author   Igor Kekeljevic & Nikola Vasiljevski
@@ -348,12 +349,14 @@
                         ';
                 }
             }
-
-            // Breadcrump Support           
-            if (JFactory::getApplication()->getMenu()->getActive()->query['view'] == "layout") {
-                $this->writeBreadcrum();
-            }
-
+         //tk LOYTEC patch 2015-01-09
+         // Breadcrump Support
+         $active = JFactory::getApplication()->getMenu()->getActive();
+         if (isset($active) && $active->query['view'] == 'layout') $this->writeBreadcrum();
+         /*if (JFactory::getApplication()->getMenu()->getActive()->query['view'] == "layout") {
+            $this->writeBreadcrum();
+         }
+         */ //tk--
             $this->doc->addScriptDeclaration('var albumInitFolders_' . $this->articleID . '="' . implode(",", $this->albumInitFolders) . '";');
         }
         $this->imagesFolderPhysicalPath = $this->sitePhysicalPath . $this->params['rootFolder'] . $this->imagesFolderName . DS;



Top
 Profile  
 
 Post subject: Trying to get property of non-object - if active menu null
PostPosted: Fri Jan 09, 2015 5:06 pm 
Top  
PostPosted: Thu Mar 19, 2015 3:26 pm 
Offline
Developer
Developer
User avatar

Joined: Sat Aug 14, 2010 9:31 pm
Posts: 1241
Location: Novi Sad, Serbia
Thanks for reporting this. I added it to our Git repository in revision 4 :)

_________________
Help Admiror Gallery become even better,
give us a review on JED


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

 


All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

This is the official Admiror Joomla! Community Forum. You are welcome to join the Admiror Joomla! Community. All Admiror Joomla! Extensions Users, Joomla! Developers, PHP or mySQL Developers are welcome to support & contribute to Admiror Joomla! Projects.

Joomla! is a free and open source content management system (CMS) for publishing content on the World Wide Web and intranets. With a vibrant volunteer community, user-friendly features and plenty of power, Joomla is perfect for your website!

Joomla! is written in PHP, uses object-oriented programming (OOP) techniques and software patterns, stores data in a MySQL database, and includes features such as page caching, RSS feeds, printable versions of pages, news flashes, blogs, polls, search, and support for language internationalization.

Joomla! is the property of Open Source Matters, Inc. All rights reserved. Read more about Joomla! at http://www.joomla.org/.


Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group