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

  1. Patch
  2. Manual testing
  3. Reviews

User interface changes

Adds an error message.

Screenshot from working patch:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lendude created an issue. See original summary.

Lendude’s picture

The last submitted patch, 2: config_single_select-2728507-2-TEST_ONLY.patch, failed testing.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Kristen Pol’s picture

Version: 8.9.x-dev » 9.1.x-dev
Status: Needs review » Needs work
Issue tags: +Bug Smash Initiative

Thanks for the issue and patch. Needs reroll for 9.1.x.

+++ b/core/modules/config/src/Tests/ConfigSingleImportExportTest.php

This has been moved to:

core/modules/config/tests/src/Functional/ConfigSingleImportExportTest.php
Kristen Pol’s picture

Status: Needs work » Closed (cannot reproduce)
FileSize
65.21 KB

I 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.

Kristen Pol’s picture

I tried to find a similar issue but couldn't see one so leaving status as is.

Lendude’s picture

In 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

pameeela’s picture

Issue summary: View changes
Status: Closed (cannot reproduce) » Active

Was 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.

Kristen Pol’s picture

@Lendude & @pameeela Thanks!

Lendude’s picture

Status: Active » Needs review
FileSize
978 bytes
1.69 KB

Reroll and a new test only patch to show that this is still an issue

The last submitted patch, 17: 2728507-17-TEST_ONLY.patch, failed testing. View results

pameeela’s picture

Patch works:

I'll leave in NR for a patch review but manual testing is done!

mradcliffe’s picture

Thank 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.

pameeela’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

I don't really think the IS template adds much here but I've added it and added the screenshot :)

igorbarato’s picture

I'm helping to review.

igorbarato’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I reviewed the patch code and not changes are necessary.

  • catch committed c976dbb on 9.1.x
    Issue #2728507 by Lendude, Kristen Pol, pameeela: Not selecting an...

  • catch committed a91ea83 on 9.0.x
    Issue #2728507 by Lendude, Kristen Pol, pameeela: Not selecting an...

  • catch committed 7ed24a5 on 8.9.x
    Issue #2728507 by Lendude, Kristen Pol, pameeela: Not selecting an...
catch’s picture

Version: 9.1.x-dev » 8.9.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.1.x and cherry-picked back to 8.9.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.