1 edb May 28, 2008 23:24
3 afwas Jun 09, 2008 02:17
This solves the problem.
1) Add this function to the class Log in /inc/_core/model/_log.class.php:
/**
* Remove a message from the log
* Foppe >> This seems the best way to solve a conflict (two seemingly conflicting messages
* when changing User profile through a plugin)
*
* @param string the message
* @param string the category
*
*/
function remove( $message, $category = NULL )
{
if( $category === NULL )
{ // By default, we use the default category:
$category = $this->defaultcategory;
}
$custom_key = array_keys( $this->messages[ $category ], $message );
unset( $this->messages[ $category ][ $custom_key[0] ] );
$this->_count[ $category ] = $this->_count[ $category ] -1;
}
2) Add the second line after the first in /inc/users/users.ctrl.php on lines 451 *and* around line 531:
if( $any_plugin_settings_updated )
{
$Messages->add( T_('Usersettings of Plugins have been updated.'), 'success' );
$Messages->remove( T_('Your profile has not been changed.'), 'note' );
}
The lines with the function remove are the new lines.
As said, this works but I can't see if this is the proper or best way to trigger the problem.
Good luck
Difficult.
The message "Your profile has not been changed." depends on $current_User->dbupdate()
The plugin however doesn't store the $current_User in the database but stores it's settings in the Plugins section of the database, so the message is correct: $current_User->dbupdate() didn't happen.
Good luck