Problem/Motivation

when the method FeaturesUIController::getConfigDependents prepare results to return to user, the config package are checked at line ~123

    foreach ($item_names as $item_name) {
      if ($config_collection[$item_name]->getPackage()) {
        foreach ($config_collection[$item_name]->getDependents() as $dependent_item_name) {
          [...]
        }
      }
    }

But, when I configure features bundle assignements to ignore all items execpt dependencies, this control continue to be make ( and desactivate field_storage autoselection beacause their not be attached on a package).

Steps to reproduce:
- Fresh standard installation
- go /admin/config/development/features/bundle
=> create new bundle "test"
=> uncheck all assignement method execpt "Forward dependency" and "Dependency"
=>save
- create new feature
- select a field or a content type

Result : no field storage selected in results
Cause : condition if ($config_collection[$item_name]->getPackage()) {
Question : in this case ( no package detection), why this condition are active ?

Proposed resolution

  • Add test(s) to cover the bug.
  • Refactor to remove duplication between FeaturesUIController::getConfigDependents() and FeaturesManager::assignConfigDependents().
  • Fix the bug.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

DrDam created an issue. See original summary.

nedjo’s picture

But, when I configure features bundle assignements to ignore all items execpt dependencies, this control continue to be make ( and desactivate field_storage autoselection beacause their not be attached on a package).

I'm not totally following what you've done here. Could you please list the exact steps you took, what you expected, and what you actually observed? Thanks.

nedjo’s picture

Status: Active » Postponed (maintainer needs more info)
DrDam’s picture

List of actions :
- Fresh standard installation
- go /admin/config/development/features/bundle
=> create new bundle "test"
=> uncheck all assignement method execpt "Forward dependency" and "Dependency"
=>save
- create new feature
- select a field or a content type

Result : no field storage selected in results
Cause : condition if ($config_collection[$item_name]->getPackage()) {
Question : in this case ( no package detection), why this condition are active ?

DrDam’s picture

Status: Postponed (maintainer needs more info) » Active
nedjo’s picture

Component: User interface » Code
Category: Support request » Bug report
Issue summary: View changes

Thanks for the detailed explanation.

I'm not super familiar with this part of the code base. That said, I'm skeptical about the implementation. Ideally we wouldn't have a generally useful method like this in a controller. It looks like we have some duplication between FeaturesUIController::getConfigDependents() and FeaturesManager::assignConfigDependents(). IT looks like we should:

  • Add test(s) to cover the bug you've noted.
  • Refactor to remove duplication between FeaturesUIController::getConfigDependents() and FeaturesManager::assignConfigDependents().
  • Fix the bug.