J!Extensions Store™
Forum
Welcome, Guest
Please Login to access forum.
Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php (1 viewing) 
Go to bottom
TOPIC: Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php
#5248
Brian
Fresh Boarder
Posts: 5
User Offline
Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php Karma: 0  
Code:

Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php on line 98
With Developer debug set, the above error appears on contact and contact list pages. I'm not sure why the plugin is called in this context or if it can do any harm. The context is passed as "com_contact.contact" or "com_contact.category", with &$article definatly not an Article. Brian
 
Logged Logged  
  The administrator has disabled public write access.
#5249
John Dagelmore
Admin
Posts: 3716
User Offline
Re:Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php Karma: 79  
That's normal, Joomla calls every content plugins from different context not only com_content context.
Obviously this allows to use content plugins outside the com_content. If you prefer you can add an extra condition before that line such as:

Code:

if($context != 'com_content.article') { return false; }
Regards John
 
Logged Logged  
  The administrator has disabled public write access.
#5250
Brian
Fresh Boarder
Posts: 5
User Offline
Re:Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php Karma: 0  
If this were my code, sure. I'm just pointing out you have a bug.
 
Logged Logged  
  The administrator has disabled public write access.
#5251
John Dagelmore
Admin
Posts: 3716
User Offline
Re:Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php Karma: 79  
If i'd add this code the plugin could not be used anymore with Joomla modules and other components than com_content. Me and other users don't want this. However this is not a bug.
 
Logged Logged  
  The administrator has disabled public write access.
#5252
Brian
Fresh Boarder
Posts: 5
User Offline
Re:Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php Karma: 0  
[code]
if(!isset($article->text)) {
if (isset($article->introtext)){
$article->text = $article->introtext;
}
else {
$article->text = '';
}
}

{/code]

The above would avoid the PHP warning in your code, in any context.
 
Logged Logged  
  The administrator has disabled public write access.
#5253
John Dagelmore
Admin
Posts: 3716
User Offline
Re:Notice: Undefined property: stdClass::$introtext in /plugins/content/instantpaypal/instantpaypal.php Karma: 79  
thank you
 
Logged Logged  
  The administrator has disabled public write access.
Go to top