I've just found that as a result of latest changes, Features is not working anymore with multiple bundles. The problem is when displaying configuration for a bundle it doesn't detect configuration in other bundles (FeaturesAssignmentExisting) and it reports all the other bundles' configuration as Unpackaged.

This is caused by:
#2596063: FeaturesManager::getExistingPackages() should limit to the current bundle
#2596047: Duplicate packages generated

However, I'm wondering: is this an intended change? are bundles supposed to be completely independent / overriding each other?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jose Reyero created an issue. See original summary.

nedjo’s picture

Assuming all assignment plugins are enabled and at their default settings, the expected behaviour as I understand it is:

At admin/config/development/configuration/features, if there is a bundle selected in the "Bundle" select, the configuration listed should be limited to what is not provided by any module or the install profile (whether or not that module or profile is marked as a "feature") other than ones that are in the current bundle.

So for example, if you create a bundle, generate some features, export and enable them, then create a new bundle and select it at admin/config/development/configuration/feature, you should see only config that hasn't been assigned to any bundle.

The general use case this is designed to meet is: When you are basing a site off of a distribution, or creating a sub-distribution, you want to leave the original distribution unchanged. So you want to be able to work with everything that's still available on the site, but not what's already part of the other distribution (which might be represented as another bundle). But you might also be a maintainer of the other distribution, in which case you want to be able to switch back to that bundle and work on it.

@Jose Reyero: Is the behaviour I've described different from what you're seeing? Is it different from what you're expecting? Can you explain a bit more about your use case and what you'd like to see happen here? Possibly there's a configuration option we could add to the exclude plugin that would meet your requirements.

Jose Reyero’s picture

@nedjo,

So for example, if you create a bundle, generate some features, export and enable them, then create a new bundle and select it at admin/config/development/configuration/feature, you should see only config that hasn't been assigned to any bundle.

This is not what I'm seeing. I see all the config that is not in current bundle (Configuration in other bundles shows up as unpackaged).

This is easier to see if you leave the install profile out of the equation and just create two bundles.

nedjo’s picture

I can't reproduce this issue. Maybe it's been fixed through a commit on a different issue?

Steps I followed:

  • Install with the Standard profile.
  • Enable features, create bundlea, and generate and install bundlea_comment and bundlea_core.
  • Create bundleb and view features export form. Configuration from bundlea does not show on export form.

@Jose Reyero: can you have another look and, if you can still reproduce from a new install, give steps? Thanks!

nedjo’s picture

Ah, but when I try this I do see an error:

  • Install with the Standard profile.
  • Enable features, create bundlea, and generate and install bundlea_comment and bundlea_core.
  • View features export form and switch to "None" for bundle. Configuration from bundlea shows on export form (assigned to comment and core bundles).
Jose Reyero’s picture

Priority: Normal » Major
FileSize
84.31 KB
80.39 KB

Thanks @nedjo, but not sure we are getting anywhere here. These are screenshots with:
- A fresh checkout of Features, Config Update, Drupal Core
- A "Bundle One" with a feature containing the Article content type.
- A "Bundle Two" with a feature containing the Basic page content type.

As you can see, added configuration in one bundle appears as unpackaged in the other, namespaces are messed up (see the red warnings), etc...

I'd provide a patch but I really need to clear this out first, because this is a critical atm on my list, latest version is just not usable at all with multiple bundles, besides being a big patch (rolling back most of the commits mentioned in #1).

nedjo’s picture

Assigned: Unassigned » nedjo

I'm having a look.

  • nedjo committed 5d6b9ac on 8.x-3.x
    Issue #2602032 by nedjo: prevent adding configuration marked as exension...
nedjo’s picture

Status: Active » Needs review

Some at least of this bug arose from changes introduced in #2443589: Offer ability to add configuration overrides to install profile. Instead of unsetting configuration that's provided by extensions, we mark it as extension-provided. I found and fixed an error in the test for extension-provided configuration in FeaturesManager::assignConfigPackage().

That won't address the bug of namespaces apparently being added twice, which may need a separate bug report. But it may have fixed the originally reported issue.

@Jose Reyero: is this working better?

nedjo’s picture

@Jose Reyero:

I posted #2606926: Error "The following module is missing from the file system" and applied an attempted fix. If you get a chance, could you look at that too and see if that's addressed the issue? Thanks!

nedjo’s picture

Status: Needs review » Fixed

In #2606926: Error "The following module is missing from the file system" I included a relevant fix.

The issue was in the 'exclude' assignment plugin. A configurable option allows exclusion of extension-provided configuration. That can be overridden by selecting the option to not exclude configuration provided by the install profile. This handling seems a likely source of the issue reported in this issue. Because of the install profile exception, configuration that had been exported already reappeared.

A simple fix would be to disable the exception for the install profile, which is really useful only after first installing a site.

Still, because there doesn't seem to be a valid use case for skipping the exclusion of profile-provided configuration if that configuration has been re-exported, I made the following change (see patch):

Tweak the handling of profile-provided configuration in FeaturesAssignmentExclude::assignPackages() such that (a) we always use the installed profile and (b) If the configuration has been assigned to a feature that's present on the file system, we don't make an exception for it. This addresses what appears as a bug, where already-assigned configuration shows up for reassignment.

Together with the previous fix in this issue the original problem should be addressed, but please reopen if not.

Jose Reyero’s picture

Thanks, latest patches have been some improvement. There are still some issues though.

Attached screenshots of my features:
a) With al the plug-ins enabled and in default state (conflict-01)
b) Disabling the "Base type" plug-in, it may be some clue (conflict-02)

Note the reported Conflicts, I cannot find a reason for them.

One more issue is existing features not being reported when selecting Bundle "None". Previously all the features were being displayed when no bundle selected. Is this intended behavior?

@nedjo,

Still, because there doesn't seem to be a valid use case for skipping the exclusion of profile-provided configuration...

Not sure I get this.... What if I'm not building a distribution, but single feature modules? Then they should be independent of the install profile, shouldn't they?

Status: Fixed » Closed (fixed)

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