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.
Right now when you run a config import and have a storage conflict you get an error that says
"Cannot change the field type for an existing field storage."
While this might be clear when working on one field at a time, it is not specific enough when working with many fields. I propose changing the error message to say something like
"The field storage forcurrent_field_name
is already set tocurrent_field_type
. Cannot change the field type for an existing field storage"
to make development easier.
Comment | File | Size | Author |
---|---|---|---|
#10 | core-field-storage-error-message-3050264-3.patch | 2.79 KB | rloos289 |
Comments
Comment #2
rloos289 CreditAttribution: rloos289 at Phase2 commentedComment #3
jhedstromThis looks great, and will definitely provide better feedback.
Just some tiny nitpicks:
This should use single quotes around the quoted text. The last sentence should end in a
.
too.(I'm guessing this text is referenced somewhere in a test too, so that will need updating once the testbot tells us where it is :)
Comment #4
rloos289 CreditAttribution: rloos289 at Phase2 commentedComment #5
rloos289 CreditAttribution: rloos289 at Phase2 commentedComment #6
jhedstromThis makes sense to me. It would greatly improve the ability to debug a bad config import where a storage type has changes somehow.
Comment #7
alexpottIf we improving one of the messages let's improve both.
Let's use sprintf() here. And I think we should put the important part of the message first ie. the error. And I think we should use the id() and not the name. So something like:
Comment #8
alexpottAlso we can test the message in \Drupal\Tests\field\Kernel\FieldStorageCrudTest::testUpdateFieldType()
Comment #10
rloos289 CreditAttribution: rloos289 at Phase2 commentedNew patch incorporating the suggested changes and adding in testing.
Comment #11
rloos289 CreditAttribution: rloos289 at Phase2 commentedComment #12
rloos289 CreditAttribution: rloos289 at Phase2 commentedComment #13
jhedstromI think the patch in #10 addresses everything in #7.
Comment #14
alexpottCommitted and pushed acb5680268 to 9.0.x and c176cfadea to 8.9.x. Thanks!