Problem/Motivation

Drupal core provides schemas for the configuration of several plugins and plugin types, but fails to provide fallbacks for some of them. This means that if the schema naming format is action.configuration.*, for instance, no schema with that exact name exists to fall back to when a replacement value for that wildcard does not exist.

Proposed resolution

Add fallback schemas of type ignore. This does not change any behavior, but allows other code to safely use such schema naming formats without having to worry about whether or not a schema exists for the wildcard replacement values the code uses at that particular time. The necessary schemas are:

  • action.configuration.*
  • display_variant.plugin.*
  • condition.plugin.*
  • ckeditor.plugin.*
  • search.plugin.*
  • tour.tip.*
  • views.display.

We MUST NOT provide an actual schema, not even that of the plugin type's base class, because extending base classes is not required and we cannot assume anything about individual plugins' internal configuration.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork drupal-2633232

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Xano created an issue. See original summary.

xano’s picture

Status: Active » Needs review
StatusFileSize
new2.85 KB
borisson_’s picture

The code here looks great and I understand why this is being added.

Do we have to define the ignore type somewhere? Otherwise RTBC++?

xano’s picture

ignore is the second data type defined in ./core/config/schema/core.data_types.schema.yml

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

In that case, this looks great.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Let's add some test coverage since if we don't and someone removes a fallback we'll never know it is broken.

xano’s picture

We should add tests to make sure these fallback schemas exist. We'll need one test per module, and one for core, which test hardcoded lists of fallback schemas.

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

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.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.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.

tim.plunkett’s picture

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

In addition the fallback of block.settings.* should be in core.data_types.schema.yml not block.schema.yml, since it is for the core plugin not the module's config entity.

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

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now 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.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now 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.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now 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.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.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.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). 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.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now 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.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

dcam made their first commit to this issue’s fork.

dcam’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

I converted the patch in #2 to an MR and added the schema verification tests. Some of the original changes are irrelevant now because this issue is so old. But the CKEditor plugin schema is of particular note. I noticed there's no fallback for ckeditor5.plugin.*, but when I attempted to add one other tests started failing with the following message:

Failed asserting that exception of type "TypeError" matches expected exception "Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException". Message was: "Cannot assign Drupal\Core\Config\Schema\Ignore to property Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition::$schema of type Drupal\Core\TypedData\TraversableTypedDataInterface"

So there's an check for a specific data type here. I'm not sure if this invalidates the need for a fallback schema or not. I ended up removing that change from the MR.

Also, I don't know if there are other new plugin types in Core that need this treatment. If anyone knows of some, then let me know.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Left some comments on the MR.

dcam’s picture

Status: Needs work » Needs review

Attributes and a change record have been added.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

This one has been sitting around for 5 months and realized all feedback on the MR has been addressed. Going to go on a limb and mark.

borisson_’s picture

While adding a schema that ignores all it's properties doesn't make it strictly validatable yet, this issue is from well before that. I think the mr here makes the situation better, so I agree with @smustgrave, this looks rtbc.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

I'm not really sure what this change actually gives us. The issue summary says:

This does not change any behavior, but allows other code to safely use such schema naming formats without having to worry about whether or not a schema exists for the wildcard replacement values the code uses at that particular time.

But core is already safely using action.configuration.action_send_email_action: without action.configuration.* existing. What problem are we solving here?

borisson_’s picture

I don't remember talking with @Xano about this, or any of the specifics from a decade ago.

I was trying to figure out a good answer to this and I don't really have one. If there is no configuration schema it currently goes to type: undefined, and with this patch it would be type: ignore.

There is nothing to be gained from strictness or validateability. Should we close this issue instead?

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new667 bytes

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

smustgrave’s picture

Status: Needs work » Needs review

Bot rebellion

borisson_’s picture

Status: Needs review » Closed (won't fix)

As @alexpott said in #32, core's already doing this without issues and this doesn't provide any value. I'm going to go ahead and close this issue because of that.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.