I have been using features to scaffold my content types. After creating one with a collection of fields, I go into the features_ui to generate the local copy of configurations, but discovered that the feature to auto-detect the dependencies aren't working in version 8.x-3.0-beta6 (Drupal core 8.1.6 via the Lightning v1.01 distro).

Steps to reproduce:

1. Create content type
2. Add a few fields
3. Navigate to features ui (enable if not initially) and create new feature
4. Select content type created in step 1

Outcome: No other checkboxes are automatically selected based on what the content type has already.
Expected: Dependencies are selected automatically.

I think this might be a regression, but wanted to flag this as it's impeding progress on creation of new configuration items.

Comments

pcho created an issue. See original summary.

mpotter’s picture

Title: Auto-detection fails to work in recent version of features and D8 » Allow auto-assigned config in non-exported package to be auto-detected and added to new feature
Category: Bug report » Feature request
Priority: Major » Normal

Did some debugging and chatting with @pcho and learned more about this.

The issue is that when you click "Create new feature", it doesn't automatically pull in dependencies that are already put into suggested features. For example, when you create a content type called "MyTest" and then add fields, Features automatically adds a new non-exported package to the Features listing page called "MyTest" that contains the MyTest content type and dependencies. This is done as expected by the assignment plugins.

However, now when you click "Create new feature", the MyTest content type is available to be added to the new feature, but when selecting it, none of it's dependencies are auto-detected because they still belong to the MyTest feature.

I think this is somewhat "by design", but it's a crummy developer experience, especially developers coming from D7 Features.

So changing this to a "Feature Request" to allow config that is auto-assigned to a non-exported package to still be auto-detected and added to a new blank feature.

mpotter’s picture

Title: Allow auto-assigned config in non-exported package to be auto-detected and added to new feature » Auto-detection not working on Create New Feature page
Category: Feature request » Bug report
Status: Active » Needs review
StatusFileSize
new887 bytes

Oh wow. No, this was actually a bug. The Ajax callback used to auto-detect dependencies was checking for existing config in a package. But when you are on the Create New Feature page, there isn't any package yet. So it was causing a silent exception with a null object in the ajax callback.

Here is the simple patch to fix.

  • mpotter committed fd22277 on 8.x-3.x
    Issue #2778547 by mpotter: Auto-detection not working on Create New...
mpotter’s picture

Status: Needs review » Fixed

Committed to fd22277.

pcho’s picture

The patch is verified working on my stack. The performance is a little slow, though this patch did improve speeds immensely:

https://www.drupal.org/files/issues/2765911.6.patch

That being said, there is a bit of a wait even with both patches committed, so I don't know if it would be beneficial to have a loading icon show up somewhere in the UI to signify the user that something is in play, especially if the contnet type has a ton of dependencies.

But this is a completely separate feature request (enhancement).

This fix is good! Thanks for the quick turnaround.

Status: Fixed » Closed (fixed)

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