tbrehm
2012-01-23 a3d0e0549d4dcd2333199ec1566d36c55cbbcdf9
Fixed: FS#1968 - Deleting mail filter via remote API does not delete associated Custom Rules entry
1 files modified
17 ■■■■ changed files
interface/lib/classes/remoting.inc.php 17 ●●●● patch | view | raw | blame | history
interface/lib/classes/remoting.inc.php
@@ -348,8 +348,8 @@
            $this->server->fault('permission_denied','You do not have the permissions to access this function.');
            return false;
        }
        $affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id);
        $app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this);
        $affected_rows = $this->deleteQuery('../mail/form/mail_user_filter.tform.php', $primary_id,'mail:mail_user_filter:on_after_delete');
        // $app->plugin->raiseEvent('mail:mail_user_filter:on_after_delete',$this);
        return $affected_rows;
    }
@@ -2317,22 +2317,23 @@
        // set a few values for compatibility with tform actions, mostly used by plugins
        $this->oldDataRecord = $old_rec;
        $this->id = $primary_id;
        $this->dataRecord = $params;
        $this->dataRecord = $old_rec;
        //$this->dataRecord = $params;
        
        //* Get the SQL query
        $sql = $app->remoting_lib->getDeleteSQL($primary_id);
        $app->db->errorMessage = '';
        $app->db->query($sql);
        $affected_rows = $app->db->affectedRows();
        
        if($app->db->errorMessage != '') {
            if($event_identifier != '') $app->plugin->raiseEvent($event_identifier,$this);
            $this->server->fault('database_error', $app->db->errorMessage . ' '.$sql);
            return false;
        }
        
        $affected_rows = $app->db->affectedRows();
        if($event_identifier != '') {
            $app->plugin->raiseEvent($event_identifier,$this);
        }
        
        //* Save changes to Datalog
        if($app->remoting_lib->formDef["db_history"] == 'yes') {