Problem/Motivation
The error message returned upon a non existing config entity does not include entity type.
example:
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): field name: field_reference_number, bundle: test_field_1
In order to make debugging easier we could improve the error message by adding the entity type to it.
Proposed resolution
Use $entity_type that already exist in the method to improve error message.
Path to file: views/views.views.inc line 378
Remaining tasks
Create patch
User interface changes
Non
API changes
Non
Data model changes
Non
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 2985907-9.patch | 959 bytes | acbramley |
| #2 | 2985907-1.patch | 895 bytes | pasan.gamage |
Comments
Comment #2
pasan.gamage commentedAttaching patch file.
Thanks.
Comment #3
pasan.gamage commentedComment #5
dydave commentedI tried patch from #2 (on D8.6.1) and indeed, it does what it says, for example, in my case :
Along with #2916266-2: How to fix "non-existent config entity name returned by FieldStorageConfigInterface::getBundles()" , it helped me debugging and fixing the error, by identifying the entity for which the field/bundle configuration was still in DB.
Thanks for the patch.
Cheers!
Comment #6
dawehnerNice! I corrected the tags from usability to DX.
Comment #7
alexpott'A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: %entity_type, bundle: %bundle, field name: %field,'and change %entity to be %entity_typeLet's also remove the t() here and pass the variables as proper context to the error handler. Error messages should not be translated via t().
Can someone file a follow-up to remove this comment and replace it with something helpful from https://www.drupal.org/node/2451657#comment-11462881
Comment #8
acbramley commented#3005490: Replace drupal issue link in views.views.inc with helpful comment created for the follow up, patch addressing feedback coming shortly.
Comment #9
acbramley commentedThis also fixes an exception thrown when clearing cache when your DB is in this broken state:
Due to passing t() into the error() call.
Comment #10
dawehnerLooks perfect.
%is the type of placeholder which can be used in error messages.Comment #12
acbramley commentedCI blip?
Comment #13
alexpottCommitted and pushed 7151900f30 to 8.7.x and 675f87f7a6 to 8.6.x. Thanks!
Comment #16
dydave commentedThanks Alex for the review and Adam for the re-roll.
Impressive how fast this issue was processed.
Thanks everyone!
Cheers!
Comment #18
rapindrive commented#9 this works correctly for me. Thanks!!