View Issue Details

IDProjectCategoryView StatusLast Update
0015494phpList 3 applicationPlugin APIpublic16-01-19 09:56
Reporteradrian15 Assigned To 
Status resolvedResolutionfixed 
Summary0015494: processSuccesFailure is not checked ok on sendemaillib when dealing with plugins
DescriptionIn sendemailib there is a for loop sentence that checks plugins so that they run their processSuccesFailure function. Currently instead of exiting the loop when a failure has been found the loop continues so that the last plugin success or failure decision prevails.

This patch fixes the problem with a while loop sentence so that once a failure has been found it stays as a failure.

This is a block issue because it actually disables that a plugin can set an email as a Failure so that is not sent... So... the same email is sent once and once again... Actually in my tests the email was sent twice and with no rss content at all but probably there was something more broken.
Additional InformationBased on revision 1703.
TagsNo tags attached.


has duplicate 0016871 resolvedmichiel phpList 3 application Plugin method processSuccesFailure() doesn't appear to have any effect 
child of 0015498 new phpList 3 plugins Rss manager is totally broken on svn 


27-05-10 18:39


G06_plugins_sendemaillib_ProcessSuccesFailure_check_fix.patch (1,568 bytes)   
diff -urN rssfixes_G05_rssmanager_sendMessageTabSave_repeatinterval_for_non_rss_emails_fix/lists/admin/sendemaillib.php rssfixes_G06_plugins_sendemaillib_ProcessSuccesFailure_check_fix/lists/admin/sendemaillib.php
--- rssfixes_G05_rssmanager_sendMessageTabSave_repeatinterval_for_non_rss_emails_fix/lists/admin/sendemaillib.php	2010-05-17 07:22:28.000000000 +0200
+++ rssfixes_G06_plugins_sendemaillib_ProcessSuccesFailure_check_fix/lists/admin/sendemaillib.php	2010-05-17 07:56:20.000000000 +0200
@@ -761,8 +761,17 @@
       if ($htmlpref) {
         Sql_Query("update {$GLOBALS["tables"]["message"]} set ashtml = ashtml + 1 where id = $messageid");
+        $processSuccesFailure=1; # Let's suppose that processSucessFailure is going to be true
         foreach ($GLOBALS['plugins'] as $plugin) {
-          $plugin->processSuccesFailure ($messageid, 'ashtml', $userdata);
+          if ($plugin->iWantToProcess($cached[$messageid],$userdata)) {
+	    reset($GLOBALS['plugins']);
+	    while ($processSuccesFailure && $pluginWhile = current($GLOBALS['plugins']) ) {
+	     $processSuccesFailure = $pluginWhile->processSuccesFailure ($messageid, 'ashtml', $userdata);
+	     next($GLOBALS['plugins']);
+	    }
+	    # This is a hack so that whenever a plugin marks a message as Failure it is Failure and another plugin does not set is back to Succes. adrian15 . Useful for rss	
+	  }
 //        if (ENABLE_RSS && sizeof($rssitems))            //Obsolete by rssmanager plugin


30-11-15 17:39

administrator   ~0057361

I deprecated the call. It's unclear what it does, and even if it does something, it does it very clumsily.