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.
field_create_field invoked field_storage_create_field and then called db_create_table to create a new table. when it's failed, it will stop and throw error immediately. There's no chance to remove field_config record on failed creation.
Comment | File | Size | Author |
---|---|---|---|
#4 | 1115106-update-field-can-fail.patch | 5.53 KB | Damien Tournoud |
Comments
Comment #1
bfroehle CreditAttribution: bfroehle commented@droplet: There is a try/catch block.. what am I missing?
Comment #2
droplet CreditAttribution: droplet commented@bfroehle,
I though like you before but it isn't.
it's issue split from:
http://drupal.org/node/1052248#comment-4270018
hook_field_storage_create_field()
simple php test script:
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis definitely works for me.
By any chance, would you have xdebug with weird configuration options enabled?
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedOk, there are a couple of issues here:
Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commentedActually, this needs to go in 8.x first.
Comment #6
droplet CreditAttribution: droplet commented@#3,
Oh, right, I enabled Xdebug, and now i see the error.
#4 patch work for me.
Comment #7
chx CreditAttribution: chx commentedThat's weird. If you are updating an instance, why would the patch change that? And while at it, why is that message not 'error' ??
Comment #8
Damien Tournoud CreditAttribution: Damien Tournoud commentedPDOException can currently be triggered by
field_sql_storage_field_storage_update_field()
(see #4 for the summary). Either we catch them or we re-wrap them into a FieldException, but we need to do something.The message is not error, but it is not touched by this patch.
Comment #9
chx CreditAttribution: chx commentedWhile #8 is bogus, for consistency reasons I can accept this. Please file a followup for the missing 'error' thanks!
Comment #10
webchickLooks like this needs backporting to D7 as well.
Committed and pushed to 8.x and 7.x. Thanks!