Problem/Motivation

An existing feature may have configuration in config/optional. When the feature is regenerated, the optional items will be moved from config/optional to config/install (unless the optional package assignmeent plugin is configured such that the configuration type is optional).

Proposed resolution

We have an existing method that lists existing extension-provided configuration by directory, FeaturesExtensionStorages::listAllByDirectory(). Unfortunately, it's a protected method and is in a class that implements an interface. So:

Add a new class, FeaturesExtensionStoragesByDirectory, that extends FeaturesExtensionStorages and has a public method ::listAllByDirectory(). Also define an accompanying interface.

Call this method to determine the current location of extension-provided config and use that as the default when initializing config items.

Remaining tasks

Write test coverage.

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo created an issue. See original summary.

nedjo’s picture

Issue summary: View changes
Status: Active » Needs review
Issue tags: +Needs tests
FileSize
4.23 KB

Status: Needs review » Needs work

The last submitted patch, 2: features-optional-directory-2943737-2.patch, failed testing. View results

nedjo’s picture

Status: Needs work » Needs review
FileSize
4.15 KB
984 bytes

Removing null coalescing operator, which requires PHP 7.

nedjo’s picture

The basic functionality in the class we're replacing - that we can define custom config-providing deirectories - would better be provided by Configuration Update Manager, see #2633480: Add functionality for external storage. But meantime it might be worth fixing this bug here.

  • nedjo committed 977922e on 8.x-3.x
    Issue #2943737 by nedjo: Optional configuration reassigned to config/...
nedjo’s picture

Status: Needs review » Active

Applied to fix the bug. Setting back to active pending tests.

nedjo’s picture

Status: Active » Fixed

Well, maybe better to mark this fixed and move tests to a new issue, #2998330: Test coverage for optional configuration reassigned to config/install.

Status: Fixed » Closed (fixed)

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