MDN

Go Back   Mambo - Forums Closed for posting > Mambo 4.5.5 - Stable > FAQ's/How To's

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old November 4th, 2006, 08:34   #1
djpushplay
 
Join Date: Oct 2006
Posts: 22
djpushplay is on a distinguished road
Thumbs up Minor bug with ALL users with sendEmail = 0

While fixing another problem, I found a minor bug that occurs when you create a new article from the front end AND every single user has sendEmail turned off (i.e. set to 0 in database).

In other words, if every single user in the database has sendEmail set to 0, there is an error at around line 1396 of content.php because $user is not checked for blank. To fix this minor bug, see the following code:
Code:
if ( $isNew ) {
   // messaging for new items
   require_once( $mosConfig_absolute_path .'/components/com_messages/messages.class.php' );

   $database->setQuery( "SELECT id FROM #__users WHERE sendEmail = '1'" );
   $users = $database->loadResultArray();
   if ($users) {   //add this test HERE!
      foreach ($users as $user_id) {
         $msg = new mosMessage( $database );
         $msg->send( $my->id, $user_id, T_("New Item"), sprintf( T_('A new content item has been submitted by [ %s ]  titled [ %s ]  from section [ %s ]  and category  [ %s ]'), $my->username, $row->title, $section, $category ) );
      }
   }   //add this to close the if
}
The 2 lines with "add this" needs to be added to prevent an error from foreach.

Again, this only happens if nobody in the database has sendEmail set to 1 (i.e. everyone has it set to zero). Otherwise, you will never see this problem.
djpushplay is offline  
Old November 4th, 2006, 09:27   #2
Keith
 
Join Date: Jan 2006
Location: Windsor Ontario Canada
Posts: 1,324
Keith is on a distinguished road
Default

Wow thanks

This will be included in the MamboPro release.

Thank you,
Keith
__________________
http://www.gamingcombat.com - Gaming Combat Mambo templates, modules and components
Keith is offline  
Old November 4th, 2006, 17:37   #3
djpushplay
 
Join Date: Oct 2006
Posts: 22
djpushplay is on a distinguished road
Default

Quote:
Originally Posted by Keith View Post
Wow thanks

This will be included in the MamboPro release.

Thank you,
Keith
You're welcome. Interesting that nobody had this problem before. I guess everybody must have had sendEmail set to 1, except me.
djpushplay is offline  
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom form and users Puntiq General Questions 6 February 4th, 2005 18:52
Users not displayed after adding from msas shoffman11 Administration Questions 1 January 13th, 2005 07:59
Special Users ?? ggouweloos Administration Questions 1 March 31st, 2004 21:37
Super Admin and Admin lewisteo Wishlist & Feature Requests 22 March 11th, 2004 00:24


All times are GMT -7. The time now is 16:57.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.