The '_file_rename_widget_custom_process()' function implicitly returns NULL if the associated file cannot be loaded. This happens, for example, when a file entity has been deleted but a dangling reference (the 'target_id') still exists in a field.
When this function is used as a Form API '#process' callback, this NULL return value overwrites the form element. This is problematic because if other modules' #process callbacks don't check for a NULL '$element', it leads to fatal 'TypeError' exceptions.
To fix this, the function should always return the '$element' it receives, preventing the element from being nulled in the form processing pipeline.
The error:
TypeError: implode(): Argument #1 ($array) must be of type array, string given in implode() (Zeile xx in /var/www/html/web/modules/contrib/xx/xx.module).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3564676-2-file_rename_widget_custom_process_fix.patch | 378 bytes | dejan0 |
Issue fork file_rename-3564676
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
dejan0 commentedplease find the patch attached
Comment #5
granikThanks, committed to 1.0.x.