Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I can see the following error in watchdog while uninstalling the module.
Recoverable fatal error: Object of class Drupal\Core\Field\BaseFieldDefinition could not be converted to string in webform_uninstall() (line 763 of /Applications/MAMP/htdocs/d8/modules/webform/webform.install).
Comment | File | Size | Author |
---|---|---|---|
#5 | fatal_error_on-2499781-5.patch | 693 bytes | sumitmadan |
Comments
Comment #1
sumitmadan CreditAttribution: sumitmadan commentedComment #2
fenstratCommitted and pushed to 8.x-4.x.
Thanks for the bug report.
I couldn't reproduce this at first until I traced it back to having devel installed. Turns out the devel calls
set_error_handler('backtrace_error_handler');
which then handles this error and simply logs it to watchdog, because after all it is a *Recoverable* fatal error. Disabling devel results in the fatal printed to screen and the uninstall failing.So my guess as to why this is happening is that calling
array_diff_assoc()
on$entity_manager->getBaseFieldDefinitions('node', 'webform')
causes a string conversion on at least one of the values (a magic __toString() call?). The odd thing is it only effects$entity_manager->getBaseFieldDefinitions()
and not$entity_manager->getFieldDefinitions
. Odd. Thankfully once that all made sense it was just a matter of callingarray_diff_key()
which just looks at the keys rather thanarray_diff_assoc()
.Comment #4
sumitmadan CreditAttribution: sumitmadan commented$entity_manager->getBaseFieldDefinitions('node', 'webform')
can be changed to$entity_manager->getBaseFieldDefinitions('node')
.Comment #5
sumitmadan CreditAttribution: sumitmadan at QED42 commentedPlease review.
Comment #6
fenstratCommitted and pushed #5 to 8.x-4.x.
Good catch, thanks!
Comment #8
DanChadwick CreditAttribution: DanChadwick commented