Problem/Motivation
When importing a single config item and leaving the selector on - Select - a fatal error is given if HTML5 validation is disabled.
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 125 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Steps to reproduce:
- Go to admin/config/development/configuration/single/import
- Ensure HTML5 validation is disabled
- Click 'Import'
Expected result:
- Validation error because no value was selected in a required field
Actual result:
- Fatal error
Proposed resolution
Add validation to the form to make sure something is selected for configuration type.
Remaining tasks
PatchManual testingReviews
User interface changes
Adds an error message.
Screenshot from working patch:
Comment | File | Size | Author |
---|---|---|---|
#19 | Screenshot 2020-07-17 20.05.48.png | 22.96 KB | pameeela |
#17 | 2728507-17.patch | 1.69 KB | Lendude |
#17 | 2728507-17-TEST_ONLY.patch | 978 bytes | Lendude |
#12 | drupal-single-import.png | 65.21 KB | Kristen Pol |
#2 | config_single_select-2728507-2.patch | 1.72 KB | Lendude |
Comments
Comment #2
Lendudetest and fix
Comment #11
Kristen PolThanks for the issue and patch. Needs reroll for 9.1.x.
This has been moved to:
Comment #12
Kristen PolI just tried to reproduce this issue with the steps in the issue summary and didn't get a fatal error. It shows a form error "Please select an item in the list." This might be a duplicate but marking "cannot reproduce" for now.
Comment #13
Kristen PolI tried to find a similar issue but couldn't see one so leaving status as is.
Comment #14
LendudeIn the screenshot this is caught by the browser native HTML5 form validation.
This would only occur when this is switched off or you use a browser that doesn't do HTML5 form validation. I haven't checked if it still occurs without HTML5 form validation, but not a lot has changed in this form so I would expect so
Comment #15
pameeela CreditAttribution: pameeela commentedWas in the neighbourhood on a site with HTML5 validation disabled and confirmed this still occurs in that case, so updated the IS to add that.
Comment #16
Kristen Pol@Lendude & @pameeela Thanks!
Comment #17
LendudeReroll and a new test only patch to show that this is still an issue
Comment #19
pameeela CreditAttribution: pameeela commentedPatch works:
I'll leave in NR for a patch review but manual testing is done!
Comment #20
mradcliffeThank you for running down the steps to reproduce. I think it would help to add the screenshots to the issue summary, and might help to update the issue summary with the issue summary template.
Comment #21
pameeela CreditAttribution: pameeela commentedI don't really think the IS template adds much here but I've added it and added the screenshot :)
Comment #22
igorbarato CreditAttribution: igorbarato as a volunteer commentedI'm helping to review.
Comment #23
igorbarato CreditAttribution: igorbarato as a volunteer commentedI reviewed the patch code and not changes are necessary.
Comment #27
catchCommitted/pushed to 9.1.x and cherry-picked back to 8.9.x, thanks!