changeset 5:3a5f959af5ae

debugging aids, all commented out
author Charlie Root
date Thu, 30 Aug 2018 16:15:17 -0400
parents 1ab920879b88
children c5493dc0fac0
files program/include/rcmail_output_html.php program/lib/Roundcube/rcube.php program/lib/Roundcube/rcube_imap.php program/lib/Roundcube/rcube_imap_generic.php program/lib/Roundcube/rcube_plugin.php program/lib/Roundcube/rcube_result_index.php program/steps/mail/func.inc program/steps/utils/error.inc
diffstat 8 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/program/include/rcmail_output_html.php	Thu Jan 18 07:47:04 2018 -0500
+++ b/program/include/rcmail_output_html.php	Thu Aug 30 16:15:17 2018 -0400
@@ -605,6 +605,7 @@
                 $path = false;
             }
         }
+	#rcube::write_log('mail',"skin: $skin_path $realname $path");
 
         // read template file
         if (!$path || ($templ = @file_get_contents($path)) === false) {
@@ -633,6 +634,7 @@
         // parse for specialtags
         $output = $this->parse_conditions($templ);
         $output = $this->parse_xml($output);
+	#rcube::write_log('mail',"px: ".strlen($output));
 
         // trigger generic hook where plugins can put additional content to the page
         $hook = $this->app->plugins->exec_hook("render_page", array('template' => $realname, 'content' => $output));
@@ -1045,7 +1047,11 @@
             // return a button
             case 'button':
                 if ($attrib['name'] || $attrib['command']) {
-                    return $this->button($attrib);
+		  #rcube::write_log('lab',"button in: ".print_r($attrib,true));
+                    $but = $this->button($attrib);
+		    #rcube::write_log('lab',"button out:\n$but");
+		    return $but;
+
                 }
                 break;
 
--- a/program/lib/Roundcube/rcube.php	Thu Jan 18 07:47:04 2018 -0500
+++ b/program/lib/Roundcube/rcube.php	Thu Aug 30 16:15:17 2018 -0400
@@ -620,7 +620,6 @@
         if (($setval = $attrib[strtolower($_SESSION['language'])]) || ($setval = $attrib['en_us'])) {
             $this->texts[$name] = $setval;
         }
-
         // check for text with domain
         if ($domain && ($text = $this->texts[$domain.'.'.$name])) {
         }
@@ -628,7 +627,6 @@
         else if (!($text = $this->texts[$name])) {
             return "[$name]";
         }
-
         // replace vars in text
         if (is_array($attrib['vars'])) {
             foreach ($attrib['vars'] as $var_key => $var_value) {
@@ -653,7 +651,6 @@
         if (isset($case_mode)) {
             $text = mb_convert_case($text, $case_mode);
         }
-
         return $text;
     }
 
--- a/program/lib/Roundcube/rcube_imap.php	Thu Jan 18 07:47:04 2018 -0500
+++ b/program/lib/Roundcube/rcube_imap.php	Thu Aug 30 16:15:17 2018 -0400
@@ -814,6 +814,7 @@
      */
     protected function _list_messages($folder='', $page=NULL, $sort_field=NULL, $sort_order=NULL, $slice=0)
     {
+      	#rcube::write_log('mail',"_lm |$folder| $sort_field ".$this->threading);
         if (!strlen($folder)) {
             return array();
         }
@@ -1398,6 +1399,7 @@
             }
         }
 
+	#rcube::write_log('mail','cache? '.$this->get_mcache_engine());
         // check local cache
         if ($mcache = $this->get_mcache_engine()) {
             return $mcache->get_index($folder, $this->sort_field, $this->sort_order);
@@ -1456,7 +1458,7 @@
                 if ($search) {
                     $query = trim($query . ' UID ' . $search);
                 }
-
+		#rcube::write_log('mail',"abouttosort $sort_field $query");
                 $index = $this->conn->sort($folder, $sort_field, $query, true);
             }
 
@@ -1512,10 +1514,10 @@
      */
     protected function sort_threads($threads)
     {
+      #rcube::write_log('mail','sort_threads '.count($threads)." ".$this->sort_field);
         if ($threads->is_empty()) {
             return;
         }
-
         // THREAD=ORDEREDSUBJECT: sorting by sent date of root message
         // THREAD=REFERENCES:     sorting by sent date of root message
         // THREAD=REFS:           sorting by the most recent date in each thread
@@ -1523,7 +1525,7 @@
         if ($this->threading != 'REFS' || ($this->sort_field && $this->sort_field != 'date')) {
             $sortby = $this->sort_field ? $this->sort_field : 'date';
             $index  = $this->index($this->folder, $sortby, $this->sort_order, true, true);
-
+	    #rcube::write_log('mail',"sort_threads $sortby".print_r($index,true));
             if (!$index->is_empty()) {
                 $threads->sort($index);
             }
--- a/program/lib/Roundcube/rcube_imap_generic.php	Thu Jan 18 07:47:04 2018 -0500
+++ b/program/lib/Roundcube/rcube_imap_generic.php	Thu Aug 30 16:15:17 2018 -0400
@@ -1794,6 +1794,7 @@
         }
 
         if (!in_array($field, $supported)) {
+	  #rcube::write_log('mail',"$field not supported: $mailbox fallback");
             return new rcube_result_index($mailbox);
         }
 
--- a/program/lib/Roundcube/rcube_plugin.php	Thu Jan 18 07:47:04 2018 -0500
+++ b/program/lib/Roundcube/rcube_plugin.php	Thu Aug 30 16:15:17 2018 -0400
@@ -297,6 +297,7 @@
      */
     public function gettext($p)
     {
+      #rcube::write_log('lab',"gtxt: $p |".$this->ID."|");
         return rcube::get_instance()->gettext($p, $this->ID);
     }
 
--- a/program/lib/Roundcube/rcube_result_index.php	Thu Jan 18 07:47:04 2018 -0500
+++ b/program/lib/Roundcube/rcube_result_index.php	Thu Aug 30 16:15:17 2018 -0400
@@ -55,7 +55,7 @@
     public function init($data = null)
     {
         $this->meta = array();
-
+	#rcube::write_log('mail',"rri: ".print_r($data,true));
         $data = explode('*', (string)$data);
 
         // ...skip unilateral untagged server responses
--- a/program/steps/mail/func.inc	Thu Jan 18 07:47:04 2018 -0500
+++ b/program/steps/mail/func.inc	Thu Aug 30 16:15:17 2018 -0400
@@ -444,8 +444,9 @@
 
     // Plugins may set header's list_cols/list_flags and other rcube_message_header variables
     // and list columns
+    #rcube::write_log('thunderbird_labels','t? |'.$RCMAIL->storage->get_threading().'|');
     $plugin = $RCMAIL->plugins->exec_hook('messages_list',
-        array('messages' => $a_headers, 'cols' => $a_show_cols));
+					  array('messages' => $a_headers, 'cols' => $a_show_cols));
 
     $a_show_cols = $plugin['cols'];
     $a_headers   = $plugin['messages'];
--- a/program/steps/utils/error.inc	Thu Jan 18 07:47:04 2018 -0500
+++ b/program/steps/utils/error.inc	Thu Aug 30 16:15:17 2018 -0400
@@ -91,6 +91,7 @@
 else if ($ERROR_CODE == 603) {
     $__error_title = "DATABASE ERROR: CONNECTION FAILED!";
     $__error_text  =  "Unable to connect to the database!<br />Please contact your server-administrator.";
+    //$__error_text.=print_r(debug_backtrace());
 }
 
 // system error