Issue #2595263: Remodel packages as objects introduced a problem on creating a Bundled feature.

Errors log:
Fatal error: Cannot use object of type Drupal\features\Package as array in features/src/FeaturesGenerator.php on line 156.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mkhamash created an issue. See original summary.

mkhamash’s picture

Status: Active » Needs work
FileSize
595 bytes

Initial attempt to solve the problem.

dawehner’s picture

Status: Needs work » Needs review

It would be nice if we have a test for this bugfix.

dawehner’s picture

Thank you for the fix!

mkhamash’s picture

FIx error "Call to a member function appendFile" on initializing a bundle for an existing profile the first time.

We need to check if we still needs this code for add files from the 'standard' install profile (ASSIGNMENT METHOD PROFILE).

// Reload the profile to refresh the config array after the addition.
$profile_package = $this->featuresManager->getPackage($profile_name);

@dawehner I think certainly we need a test for it, though I am not that good with writing tests so hope someone could write more tests for features.

dawehner’s picture

The second fix seems to be for me a total unrelated issues/bugfix, isn't it?
Btw, initPackage returns the new package as well so you could assign it directly.

Here is a test for the first fix :)

mkhamash’s picture

Issue summary: View changes

Yes the second one is technically not related, but initially I thought there would be a lot more problems from code introduced in issue #2595263: Remodel packages as objects, and thought to collect them in one ticket, but unexpectedly there was not that much problems.

I will open a new issue for it anyway, to keep things organized.

dawehner’s picture

Status: Needs review » Fixed

I will open a new issue for it anyway, to keep things organized.

Thank you!

Committed the fix + test in the meantime. See you in the other issue

  • dawehner committed e4e11ab on 8.x-3.x authored by mkhamash
    Issue #2638148 by mkhamash: Bundled Features multiple fatal errors
    
mkhamash’s picture

@dawehner I think you have committed the patch in #5 for both issues and without the test you wrote.

  • dawehner committed 39d1db6 on 8.x-3.x
    Revert "Issue #2638148 by mkhamash: Bundled Features multiple fatal...
  • dawehner committed 767af8f on 8.x-3.x authored by mkhamash
    Issue #2638148 by mkhamash: Bundled Features multiple fatal errors
    
dawehner’s picture

@mkhamash
Thank you for mentioning it. Reverted the patch in #5 and committed #6, so we still need the other issue, sorry. Tests would be always nice :)

Status: Fixed » Closed (fixed)

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