Problem/Motivation

If use the Drush command fim to try to import module that has no *.features.yml file, no configuration will be "updated", and you won't get any notification for that.

Steps to reproduce

  • create new module with at least one config file in /config/install
  • Do not add .features.yml
  • try to import module with drush fim <your_module>
  • Config will not be imported (nothing happens).

Expected: Features prints a message indicating that the module is not a feature module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#12 3229045.png98.79 KBhmendes

Issue fork features-3229045

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DavorHorvacki created an issue. See original summary.

nedjo’s picture

Status: Active » Postponed (maintainer needs more info)

Hi, I'm not totally clear on what the precise issue is. Could you please fill out "steps to reproduce"? Thanks!

holo96’s picture

Issue summary: View changes
holo96’s picture

Status: Postponed (maintainer needs more info) » Active
nedjo’s picture

Title: Features should warn user if importing module with no defined bundle » Features Drush command should warn user if importing config from non-feature module
Version: 8.x-3.12 » 8.x-3.x-dev
Category: Support request » Feature request
Issue summary: View changes

@DavorHorvacki: Thanks, that makes it clear.

From the "steps to reproduce" it sounds like the issue is not to do with a defined bundle per se but that the module in question isn't a features module in the first place. I imagine a fix might include a call to FeaturesManager::isFeatureModule(). The user message on FALSE might be "[module name] is not a feature module." Updating the summary accordingly.

Patch very welcome!

There might be a distinct issue, where a *.features.yml file exists but no bundle is defined. If so, that would be a separate bug.

holo96’s picture

Exactly, thanks

paulocs’s picture

Assigned: Unassigned » paulocs

I'm working on it.

paulocs’s picture

Assigned: paulocs » Unassigned

Isn't it already doing this verification?
I tried drush features-import test

  /** @var \Drupal\features\Package $feature */
  $feature = $manager->loadPackage($module, TRUE);
  if (empty($feature)) {
    throw new DomainException(dt('No such feature is available: @module', $dt_args));
  }

I tried to run drush features-import modal_page and i got the error below:
No such feature is available: modal_page

holo96’s picture

Yes, but if you try with existing module that is not part of any features bundle (no module_name.features.yml) you won't have that error message, to be more precise, nothing will happen, neither config will be imported, neither you will get error message.

For example you can try any contrib modules: `drush features-import admin_toolbar`

paulocs’s picture

Status: Active » Needs review
hmendes’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new98.79 KB

Hello,
Tested the MR from #10 and it worked for me. Changing this to RTBC.
Tested with Drupal 9.2.7 and Features 8.x-3.x-dev.

hswong3i made their first commit to this issue’s fork.