jackburton79/room

GLPI 10: PHP user warning when creating a room

Opened this issue · 3 comments

When creating a room in Glpi 10, a PHP user warning is written in the log file php-errors.log

[2022-04-11 12:24:21] glpiphplog.WARNING: *** PHP User Warning (512): Calling isFloat on string in /usr/local/share/glpitest/src/Toolbox.php at line 3435
Backtrace :
src/Toolbox.php:3435 trigger_error()
src/Dropdown.php:1681 Toolbox::isFloat()
plugins/room/inc/room.class.php:371 Dropdown::showNumber()
src/CommonGLPI.php:655 PluginRoomRoom->showForm()
ajax/common.tabs.php:107 CommonGLPI::displayStandardTab()

i test at glpi 10.0.6
If seatting is not selected, the roms cannot added

[2023-02-23 23:51:22] glpisqllog.ERROR: DBmysql::query() in html/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: INSERT INTO `glpi_plugin_room_rooms` (`entities_id`, `is_recursive`, `name`, `locations_id`, `type`, `access`, `users_id`, `tech_num`, `size`, `groups_id_tech`, `printer`, `videoprojector`, `wifi`, `text1`, `dropdown1`, `text2`, `dropdown2`, `opening`, `limits`, `comment`, `date_mod`) VALUES ('6', '0', 'Sala PressEnter', '0', '0', '0', '0', '0', '', '0', '0', '0', '0', '', '0', '', '0', '', '', '', '2023-02-23 23:51:22')
  Error: Incorrect integer value: '' for column `glpi`.`glpi_plugin_room_rooms`.`size` at row 1
  Backtrace :
  src/DBmysql.php:1320                               
  src/CommonDBTM.php:721                             DBmysql->insert()
  src/CommonDBTM.php:1326                            CommonDBTM->addToDB()
  plugins/room/front/room.form.php:27                CommonDBTM->add()
  {"user":"70@tom"} 

The seating control is a dropdown, and it has no default value.
In my opinion a control like this would be better:
image

I'm looking how to change it.