Question - Adding a new User with Multiple Portals

When you are adding a new user to Eramba and select multiple portals, it throws an error on users_portals missing a Default Value on the created and modified fields.

Example logs below:

2020-12-09 23:27:58 Error: [PDOException] SQLSTATE[HY000]: General error: 1364 Field ‘created’ doesn’t have a default value
Request URL: /users/add?modalId=1&_=1607556455356
Stack Trace:
#0 /var/www/html/lib/Cake/Model/Datasource/Database/Mysql.php(914): PDOStatement->execute()
#1 /var/www/html/lib/Cake/Model/Model.php(2123): Mysql->insertMulti(’eramba_v2.us...', 'user_id, por…’, Array)
#2 /var/www/html/lib/Cake/Model/Model.php(1955): Model->_saveMulti(Array, ‘2’, Object(Mysql))
#3 /var/www/html/lib/Cake/Model/Model.php(1754): Model->_doSave(Array, Array)
#4 /var/www/html/lib/Cake/Model/Model.php(2515): Model->save(Array, Array)
#5 /var/www/html/app/Controller/Crud/Action/AppAddCrudAction.php(92): Model->saveAssociated(Array, Array)
#6 /var/www/html/app/Plugin/Crud/Controller/Crud/CrudAction.php(66): AppAddCrudAction->_post()
#7 /var/www/html/app/Plugin/Crud/Controller/Component/CrudComponent.php(218): CrudAction->handle(Object(CrudSubject))
#8 /var/www/html/app/Controller/UsersController.php(146): CrudComponent->execute()
#9 [internal function]: UsersController->add()
#10 /var/www/html/lib/Cake/Controller/Controller.php(499): ReflectionMethod->invokeArgs(Object(UsersController), Array)
#11 /var/www/html/app/Plugin/Crud/Lib/CrudControllerTrait.php(31): Controller->invokeAction(Object(CakeRequest))
#12 /var/www/html/lib/Cake/Routing/Dispatcher.php(193): AppController->invokeAction(Object(CakeRequest))
#13 /var/www/html/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(UsersController), Object(CakeRequest))
#14 /var/www/html/app/webroot/index.php(109): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#15 {main}

If you need a fast patch, in the MySQL/MariaDB client:
alter table user_portals alter created set default current_timestamp;
alter table user_portals alter modified set default current_timestamp;

i can not reproduce your bug on demo-e.eramba.org (admin/alphanumeric1)

can you? what strict settings you have on mysql and what version you on?

regards!

Strict Mode is off and MariaDB 10.3.27 on AWS. I will reinstall on a dev box and see if I can reproduce with MySQL instead of MariaDB.