When clicking the "Edit description" button of a directory listing, nothing happens in the UI but this error is thrown in the Apache error log:
Uncaught PHP Exception Drupal\\Core\\Database\\DatabaseExceptionWrapper: "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))' at line 2: SELECT f.*\nFROM \n{filebrowser_content} f\nWHERE (f.fid IN ()); Array\n(\n)\n" at /var/www/html/drupal/core/lib/Drupal/Core/Database/Connection.php line 671
The problem is that the nodeContentLoadMultiple() function in FilebrowserStorage.php sometimes gets a string and sometimes an array, but $query->condition('f.fid', $fids, 'IN') requires an array.
A workaround would be to write:
if (!is_array($fids)) {
$fids = explode(',', $fids);
}
at the beginning of nodeContentLoadMultiple(), but it would be better to be consistent and have all callers pass the same data type (either string or array). An array probably makes more sense, and would be consistent with the function having the same name in Common.php.
I can write the patch, if you want to. :)
Comments
Comment #3
clivesj commentedFilebrowserStorage::nodeContentLoadMultiple was already changed to accept arrays, but the description-form was still sending a string.
Fixed now.
Thanks!
Comment #4
clivesj commented