- Status changed to Postponed: needs info
over 1 year ago 8:27am 27 July 2023 - ๐จ๐ญSwitzerland salvis
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'rol_test2': DELETE FROM "node_access" WHERE ("gid" = :db_condition_placeholder_0) AND ("realm" = :db_condition_placeholder_1); Array ( [:db_condition_placeholder_0] => rol_test2 [:db_condition_placeholder_1] => forum_access ) in forum_access_user_role_delete() (line 490 of modules/contrib/forum_access/forum_access.module).
So, this results in the following query:
DELETE FROM "node_access" WHERE ("gid" = 'rol_test2') AND ("realm" = 'forum_access');
I don't see how this could produce an error message like
Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'rol_test2'
- ๐จ๐ญSwitzerland salvis
I've tried creating and deleting a role using the current -dev version (requires ACL 8.x-1.1) and I did not get any crash.
Please try this again and let us know.
- Status changed to Active
about 1 year ago 12:31pm 9 November 2023 I am able to reliably reproduce the issue with the current dev version on Drupal 9.5.11 with ACL 8.x-1.1.
Here are the steps to reproduce the issue:
- Set up a fresh Drupal installation ("standard" installation profile) - I used simplytest.me for this
- Install forum_access
- Create a role with name "Test"
- Edit the "General discussion" forum and allow the new role to "View this forum" and "Post in this forum"
- Save (and rebuild permissions)
- Create a forum post in the "General discussion" forum
- Delete the role with name "Test"
-> Issue occursDrupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'test': DELETE FROM "node_access" WHERE ("gid" = :db_condition_placeholder_0) AND ("realm" = :db_condition_placeholder_1); Array ( [:db_condition_placeholder_0] => test [:db_condition_placeholder_1] => forum_access ) in forum_access_user_role_delete() (line 503 of /var/lib/tugboat/stm/web/modules/contrib/forum_access/forum_access.module).
- Status changed to Needs review
about 1 year ago 12:56pm 9 November 2023 Now that I've looked at the code, I think I've also identified the issue. In the query you (@galvis) have already shown above
DELETE FROM "node_access" WHERE ("gid" = 'rol_test2') AND ("realm" = 'forum_access');
we pass the role ID (which is a string since Drupal 8/9) to "gid". However, the "gid" column in the database is actually an integer column. We need to map the role ID to the "gid" first (similar to as it's also done at other places in the module).
I have created a merge request that implements this and I was not able to reproduce the issue anymore.
- Open on Drupal.org โCore: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22last update
about 1 year ago Waiting for branch to pass - @nicob opened merge request.
- Open on Drupal.org โCore: 9.5.x + Environment: PHP 8.1 & MariaDB 10.3.22last update
about 1 year ago Waiting for branch to pass