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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo created an issue. See original summary.

leymannx’s picture

After 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?

philosurfer’s picture

same...
bump++

weynhamz’s picture

This 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...

weynhamz’s picture

Attached 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.

Status: Needs review » Needs work

The last submitted patch, 5: 2947655-5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

philosurfer’s picture

patch #5 is working.

test failures seem to be CS issues only ;)

nedjo’s picture

Status: Needs work » Reviewed & tested by the community

Thanks, the fix looks good. The test errors are indeed unrelated.

  • nedjo committed 0c2b33a on 8.x-4.x authored by weynhamz
    Issue #2947655 by weynhamz: Incorrect error message logged for each...

  • nedjo committed 764bff7 on 8.x-3.x authored by weynhamz
    Issue #2947655 by weynhamz: Incorrect error message logged for each...
nedjo’s picture

Status: Reviewed & tested by the community » Fixed

Applied, thanks!

Status: Fixed » Closed (fixed)

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