From 0f80e158ff23f5428f9cb50a171771e45fa5b55b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 28 Oct 2018 09:28:01 +0100 Subject: [PATCH 1/2] also set Error/Errno, if database is readonly --- api/src/Db.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/src/Db.php b/api/src/Db.php index 48e542d6e8..77628989f6 100644 --- a/api/src/Db.php +++ b/api/src/Db.php @@ -757,7 +757,12 @@ class Db if (($this->readonly || $this->log_updates) && !preg_match('/^\(?(SELECT|SET|SHOW)/i', $Query_String)) { if ($this->log_updates) error_log($Query_String.': '.function_backtrace()); - if ($this->readonly) return 0; + if ($this->readonly) + { + $this->Error = 'Database is readonly'; + $this->Errno = -2; + return 0; + } } if ($num_rows > 0) { From 9c08c4cee7fd070ceee63fd8f76dd25c30907ae3 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 29 Oct 2018 15:11:32 +0100 Subject: [PATCH 2/2] Fix et2_htmlarea disabled not working --- api/js/etemplate/et2_widget_htmlarea.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/api/js/etemplate/et2_widget_htmlarea.js b/api/js/etemplate/et2_widget_htmlarea.js index 5e1201ce28..8c4bc4193c 100644 --- a/api/js/etemplate/et2_widget_htmlarea.js +++ b/api/js/etemplate/et2_widget_htmlarea.js @@ -158,6 +158,25 @@ var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2 this.tinymce = tinymce.init(settings); }, + /** + * set disabled + * + * @param {type} _value + * @returns {undefined} + */ + set_disabled: function(_value) + { + this._super.apply(this, arguments); + if (_value) + { + jQuery(this.tinymce_container).css('display', 'none'); + } + else + { + jQuery(this.tinymce_container).css('display', 'flex'); + } + }, + /** * Callback function runs when the filepicker in image dialog is clicked * @@ -212,6 +231,8 @@ var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2 this.editor.execCommand('fontName', true, egw.preference('rte_font', 'common')); this.editor.execCommand('fontSize', true, egw.preference('rte_font_size', 'common') + egw.preference('rte_font_unit', 'common')); + if (!this.disabled) jQuery(this.editor.editorContainer).css('display', 'flex'); + this.tinymce_container = this.editor.editorContainer; }, /** @@ -262,6 +283,7 @@ var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2 } this.editor = null; this.tinymce = null; + this.tinymce_container = null; this.htmlNode.remove(); this.htmlNode = null; this._super.apply(this, arguments);