Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When running drush features-export [feature-name] the existing bundle information is lost and the whole features array in the updated module gets something like features => TRUE (don't know whether that makes any sense).
I think existing bundles should be preserved. A patch will follow.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2593671.01.patch | 905 bytes | Jose Reyero |
|
Comments
Comment #2
Jose Reyero CreditAttribution: Jose Reyero at Axel Springer España commentedPossibly this should be fixed somewhere else in the features generation stack.
This is a quick drush patch that will work unless we are missing features from different bundles.
Comment #3
nedjoThanks for the patch. This is indeed a bug. The basic issue seems to be: the "current" bundle may vary depending on which feature is being exported. This isn't an issue when using the module's UI, because there you first select the bundle and then select one or more features.
We have some relevant methods in
FeaturesAssigner
, so we could use something along the lines of:It looks like that should go earlier in the function, before the line:
But what if someone tries to export multiple features from distinct bundles? Do we need to determine and set the bundle per feature?
Maybe instead we:
Comment #4
Jose Reyero CreditAttribution: Jose Reyero at Axel Springer España commentedRight, this patch is not really a solution, what I meant in the previous post was "that will work unless we are mixing features from different bundles", it was a typo.
I think this should be fixed better when building the new info file, maybe in FeaturesGenerationMethodBase, by not overriding the 'features' part of the info if a bundle is not specified. Unlike this patch, that would work for mixed bundles too.
I'll post some new patch when I find the time, I just needed a quick solution for drush in the meanwhile.
Comment #5
Jose Reyero CreditAttribution: Jose Reyero at Axel Springer España commentedI think this doesn't make too much sense anymore. Testing with latest version, it seems:
- If you don't specify a bundle, it will default to 'default' bundle, the feature just won't be found. Message "The package ignore does not exist."
- If adding the --bundle=bundle_name option, it works, the bundle name is not lost anymore.