Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When generating packages, an error message is logged for each package not generated.
Steps to reproduce:
- Install a new site with the standard install profile.
- Install Features UI and create a new features bundle.
- On the Features admin page, select 'Article' and click 'Write'.
- Review the log. It has messages such as "Failed to package page. Package not found."
Since the page package was not selected, there should be no error message.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#5 | 2947655-5.patch | 1.29 KB | weynhamz |
Comments
Comment #2
leymannxAfter I once accidentally created a package (let's say it's named "program_offer") in the default bundle, deleted it, then recreated it in my custom bundle (let's say now it's named "mybundle_prgram_offer") I always get this error. Everything works just fine. It's this error only.
$ drush -y fl --bundle=mybundle
[error] Failed to package program_offer. Package not found.
... then comes the table
And when I import packages it also raises a notice.
$ drush -y fia --bundle=mybundle
[error] Failed to package program_offer. Package not found.
... then everything works fine
It's just this annoying error. And I don't know where it got the package name stored. Is it in the database? And didn't it got deleted properly?
Comment #3
philosurfer CreditAttribution: philosurfer commentedsame...
bump++
Comment #4
weynhamzThis error is caused by plugin `FeaturesAssignmentBaseType` plugin at locations [1][] and [2][]. Location [1][] `FeaturesManager::initPackage()` inits the package if does not already exists, but it also checks the package with same name within current bundle, but location [2][] does not know/check the current bundle information, that's way it throws this error.
The fix, should be pass the bundle information into `assignConfigPackge` method and perform the same logic to get the package with the same name from current bundle, then maybe just skip? I am not sure if we need to assign config item to existing packages.
[1]: https://git.drupalcode.org/project/features/blob/8.x-3.x/src/Plugin/Feat...
[2]: https://git.drupalcode.org/project/features/blob/8.x-3.x/src/Plugin/Feat...
Comment #5
weynhamzAttached patch tried to get the package from current bundle with the same name, I am not sure should we proceed assignment at this case or should we just bailout.
Comment #7
philosurfer CreditAttribution: philosurfer commentedpatch #5 is working.
test failures seem to be CS issues only ;)
Comment #8
nedjoThanks, the fix looks good. The test errors are indeed unrelated.
Comment #11
nedjoApplied, thanks!