The "Acknowledge" action silently fails if the comment textarea contains more than 255 chars

XMLWordPrintable

    • Type: Incident report
    • Resolution: Duplicate
    • Priority: Trivial
    • None
    • Affects Version/s: 2.0.2
    • Component/s: Frontend (F)
    • Environment:
      Firefox, Ubuntu 12.04

      If a user on the zabbix/acknow.php page enters more than 255 characters into the Message comment field textarea, when "Save and return" is clicked, the acknowledge is dropped and the comment is lost. No error message is given, and it's not clear that the acknowledge didn't get processed. The 255 character limit appears to be due to the column size of the database table 'acknowleges'.

      The following patch constrains the comment textarea to 255 characters, which will prevent the problem.

      diff /var/www/zabbix/acknow.php ~/zabbix-2.0.2/frontends/php/acknow.php
      208c208
      < $frmMsg->addRow(_('Message'), new CTextArea('message', '', ZBX_TEXTAREA_STANDARD_ROWS, ZBX_TEXTAREA_BIG_WIDTH, false, 255));

      > $frmMsg->addRow(_('Message'), new CTextArea('message', '', ZBX_TEXTAREA_STANDARD_ROWS, ZBX_TEXTAREA_BIG_WIDTH));

      diff /var/www/zabbix/include/classes/class.ctextarea.php ~/zabbix-2.0.2/frontends/php/include/classes/class.ctextarea.php
      31c31
      < public function __construct($name = 'textarea', $value = '', $rows = ZBX_TEXTAREA_STANDARD_ROWS, $width = ZBX_TEXTAREA_STANDARD_WIDTH, $readonly = false, $maxlength='') {

      > public function __construct($name = 'textarea', $value = '', $rows = ZBX_TEXTAREA_STANDARD_ROWS, $width = ZBX_TEXTAREA_STANDARD_WIDTH, $readonly = false) {
      37d36
      < $this->attr('maxlength', $maxlength);

            Assignee:
            Unassigned
            Reporter:
            Kester Allen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: