Problem/Motivation

The dependencies in a module's .info.yml file must be an array. I mistakenly added a single dependency as a string, which is valid yaml, and spent far too long debugging issues installing a site from existing config. I'm wondering how I could have prevented this and thought perhaps coder could detect this. Alternatively Drupal could allow a string OR array. Ultimately this was just a dumb mistake.

Steps to reproduce

Create a module with a single dependency not in an array:

dependencies:
  drupal:taxonomy

Proposed resolution

Detect this pattern

Remaining tasks

Determine if this is appropriate for coder

User interface changes

N/A

API changes

N/A

Data model changes

N/A

CommentFileSizeAuthor
#2 3166470-2.patch2.02 KBbranjansse

Comments

mstrelan created an issue. See original summary.

branjansse’s picture

Status: Active » Needs review
StatusFileSize
new2.02 KB

Please review the patch for coder.
https://git.drupalcode.org/project/coder.git

arkener’s picture

Status: Needs review » Needs work

@branjansse Thank you for working on this, could you add a PR against https://github.com/pfrenssen/coder and add a test for this issue so we can see the test results?

branjansse’s picture

Thank you @arkener for your comment. Please check the PR I have raised. https://github.com/pfrenssen/coder/pull/127

klausi’s picture

Status: Needs work » Needs review
klausi’s picture

Status: Needs review » Needs work

Cool, left a couple of comments there, can you fix those?

branjansse’s picture

Thanks @klausi for the review. I will definitely fix those issues and share the update here.

branjansse’s picture

Status: Needs work » Needs review

@klausi I have fixed the issues you have suggested. Please review.

klausi’s picture

Status: Needs review » Needs work

Thanks, only some minor points left!

branjansse’s picture

Status: Needs work » Needs review

@klausi i have fixed and pushed the code. Please review.

klausi’s picture

Status: Needs review » Needs work

Still some small things to do on the pull request, setting to needs work for that.

jonathan1055’s picture

Assigned: Unassigned » jonathan1055

This was close to being finished two years ago but then no activity for a year, so the PR was closed. I will make a new PR, address the problems and finish it off.

jonathan1055’s picture

Title: Ensure module dependencies are an array » Ensure module dependencies are an array in .info.yml
Assigned: jonathan1055 » Unassigned
Status: Needs work » Needs review

New PR is https://github.com/pfrenssen/coder/pull/186 ready for review
Credit to @branjansse for the initial work.

  • jonathan1055 authored 95755352 on 8.3.x
    feat(DependenciesArray): Ensure module dependencies are an array in ....
klausi’s picture

Status: Needs review » Fixed

Merged, thanks!

jonathan1055’s picture

Thank you.

Status: Fixed » Closed (fixed)

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