Index: create/bin/gen_php.php =================================================================== --- create/bin/gen_php.php (revision 69294) +++ create/bin/gen_php.php (working copy) @@ -56,9 +56,12 @@ $length = $type_data['length']; break; case 't_blob': + case 't_shorttext': + $type = 'DB::FIELD_TYPE_SHORTTEXT'; + $length = false; + break; case 't_text': case 't_longtext': - case 't_shorttext': $type = 'DB::FIELD_TYPE_TEXT'; $length = false; break; Index: frontends/php/include/classes/api/CApiService.php =================================================================== --- frontends/php/include/classes/api/CApiService.php (revision 69294) +++ frontends/php/include/classes/api/CApiService.php (working copy) @@ -856,8 +856,9 @@ foreach ($options['filter'] as $field => $value) { // skip missing fields and text fields (not supported by Oracle) // skip empty values - if (!isset($tableSchema['fields'][$field]) || $tableSchema['fields'][$field]['type'] == DB::FIELD_TYPE_TEXT - || zbx_empty($value)) { + if (!isset($tableSchema['fields'][$field]) + || $tableSchema['fields'][$field]['type'] == DB::FIELD_TYPE_SHORTTEXT + || $tableSchema['fields'][$field]['type'] == DB::FIELD_TYPE_TEXT || zbx_empty($value)) { continue; } Index: frontends/php/include/classes/db/DB.php =================================================================== --- frontends/php/include/classes/db/DB.php (revision 69294) +++ frontends/php/include/classes/db/DB.php (working copy) @@ -37,6 +37,7 @@ const FIELD_TYPE_FLOAT = 'float'; const FIELD_TYPE_UINT = 'uint'; const FIELD_TYPE_BLOB = 'blob'; + const FIELD_TYPE_SHORTTEXT = 'shorttext'; const FIELD_TYPE_TEXT = 'text'; private static $schema = null; @@ -253,7 +254,8 @@ if ($DB['TYPE'] == ZBX_DB_MYSQL) { foreach ($tableSchema['fields'] as $name => $field) { - if ($field['type'] == DB::FIELD_TYPE_TEXT && !$field['null']) { + if (($field['type'] == DB::FIELD_TYPE_SHORTTEXT || $field['type'] == DB::FIELD_TYPE_SHORTTEXT) + && !$field['null']) { foreach ($values as &$value) { if (!isset($value[$name])) { $value[$name] = ''; @@ -353,7 +355,7 @@ } $values[$field] = zbx_dbstr($values[$field]); break; - case self::FIELD_TYPE_TEXT: + case self::FIELD_TYPE_SHORTTEXT: if ($DB['TYPE'] == ZBX_DB_DB2 || $DB['TYPE'] == ZBX_DB_ORACLE) { $length = mb_strlen($values[$field]); @@ -364,6 +366,9 @@ } $values[$field] = zbx_dbstr($values[$field]); break; + case self::FIELD_TYPE_TEXT: + $values[$field] = zbx_dbstr($values[$field]); + break; } } } Index: frontends/php/include/classes/validators/CNewValidator.php =================================================================== --- frontends/php/include/classes/validators/CNewValidator.php (revision 69294) +++ frontends/php/include/classes/validators/CNewValidator.php (working copy) @@ -282,6 +282,7 @@ case DB::FIELD_TYPE_CHAR: return (mb_strlen($value) <= $field_schema['length']); + case DB::FIELD_TYPE_SHORTTEXT: case DB::FIELD_TYPE_TEXT: // TODO: check length return true; Index: frontends/php/include/db.inc.php =================================================================== --- frontends/php/include/db.inc.php (revision 69294) +++ frontends/php/include/db.inc.php (working copy) @@ -761,6 +761,7 @@ continue; } if ($tableSchema['fields'][$field]['type'] != DB::FIELD_TYPE_CHAR + && $tableSchema['fields'][$field]['type'] != DB::FIELD_TYPE_SHORTTEXT && $tableSchema['fields'][$field]['type'] != DB::FIELD_TYPE_TEXT) { continue; } Index: frontends/php/include/schema.inc.php =================================================================== --- frontends/php/include/schema.inc.php (revision 69294) +++ frontends/php/include/schema.inc.php (working copy) @@ -22,7 +22,7 @@ ], 'description' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'active_since' => [ @@ -238,7 +238,7 @@ ], 'description' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'tls_connect' => [ @@ -944,7 +944,7 @@ ], 'variables' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'agent' => [ @@ -1029,7 +1029,7 @@ ], 'headers' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], ], @@ -1075,7 +1075,7 @@ ], 'posts' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'required' => [ @@ -1092,7 +1092,7 @@ ], 'variables' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'follow_redirects' => [ @@ -1109,7 +1109,7 @@ ], 'headers' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], ], @@ -1430,7 +1430,7 @@ ], 'description' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'inventory_link' => [ @@ -1841,7 +1841,7 @@ ], 'description' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'confirmation' => [ @@ -1910,7 +1910,7 @@ ], 'def_longdata' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'recovery_msg' => [ @@ -1927,7 +1927,7 @@ ], 'r_longdata' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'formula' => [ @@ -2009,7 +2009,7 @@ ], 'message' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'mediatypeid' => [ @@ -2136,7 +2136,7 @@ ], 'command' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], ], @@ -2737,7 +2737,7 @@ ], 'comments' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'error' => [ @@ -4172,7 +4172,7 @@ ], 'test_string' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], ], @@ -4296,7 +4296,7 @@ ], 'message' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'status' => [ @@ -4462,7 +4462,7 @@ ], 'value' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'logeventid' => [ @@ -4502,7 +4502,7 @@ ], 'value' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'ns' => [ @@ -4554,7 +4554,7 @@ ], 'value' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'logeventid' => [ @@ -4927,12 +4927,12 @@ ], 'oldvalue' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'newvalue' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], ], @@ -5372,7 +5372,7 @@ ], 'hardware_full' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'software' => [ @@ -5383,7 +5383,7 @@ ], 'software_full' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'software_app_a' => [ @@ -5418,12 +5418,12 @@ ], 'contact' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'location' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'location_lat' => [ @@ -5440,7 +5440,7 @@ ], 'notes' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'chassis' => [ @@ -5505,7 +5505,7 @@ ], 'host_networks' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'host_netmask' => [ @@ -5612,7 +5612,7 @@ ], 'site_notes' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'poc_1_name' => [ @@ -5653,7 +5653,7 @@ ], 'poc_1_notes' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], 'poc_2_name' => [ @@ -5694,7 +5694,7 @@ ], 'poc_2_notes' => [ 'null' => false, - 'type' => DB::FIELD_TYPE_TEXT, + 'type' => DB::FIELD_TYPE_SHORTTEXT, 'default' => '', ], ], Index: frontends/php/include/views/configuration.host.edit.php =================================================================== --- frontends/php/include/views/configuration.host.edit.php (revision 69294) +++ frontends/php/include/views/configuration.host.edit.php (working copy) @@ -724,7 +724,8 @@ $data['host_inventory'][$field_name] = ''; } - if ($hostInventoryTable['fields'][$field_name]['type'] == DB::FIELD_TYPE_TEXT) { + if ($hostInventoryTable['fields'][$field_name]['type'] == DB::FIELD_TYPE_SHORTTEXT + || $hostInventoryTable['fields'][$field_name]['type'] == DB::FIELD_TYPE_TEXT) { $input = (new CTextArea('host_inventory['.$field_name.']', $data['host_inventory'][$field_name])) ->setWidth(ZBX_TEXTAREA_BIG_WIDTH); } Index: frontends/php/include/views/configuration.host.massupdate.php =================================================================== --- frontends/php/include/views/configuration.host.massupdate.php (revision 69294) +++ frontends/php/include/views/configuration.host.massupdate.php (working copy) @@ -301,7 +301,8 @@ $data['host_inventory'][$field] = ''; } - if ($hostInventoryTable['fields'][$field]['type'] == DB::FIELD_TYPE_TEXT) { + if ($hostInventoryTable['fields'][$field]['type'] == DB::FIELD_TYPE_SHORTTEXT + || $hostInventoryTable['fields'][$field]['type'] == DB::FIELD_TYPE_TEXT ) { $fieldInput = (new CTextArea('host_inventory['.$field.']', $data['host_inventory'][$field])) ->setWidth(ZBX_TEXTAREA_BIG_WIDTH); }