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()
andFeaturesManager::assignConfigDependents()
. - Fix the bug.
Comments
Comment #2
nedjoI'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.
Comment #3
nedjoComment #4
DrDam CreditAttribution: DrDam commentedList 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 ?
Comment #5
DrDam CreditAttribution: DrDam commentedComment #6
nedjoThanks 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()
andFeaturesManager::assignConfigDependents()
. IT looks like we should:FeaturesUIController::getConfigDependents()
andFeaturesManager::assignConfigDependents()
.