Skip to content

fix: don't crash on a licence that isn't an SPDX identifier - #64

Merged
imorland merged 1 commit into
3.xfrom
im/unknown-licence
Oct 14, 2026
Merged

imorland merged 1 commit into
3.xfrom
im/unknown-licence

Conversation

@imorland

Copy link
Copy Markdown
Member

Fixes: no issue.

Changes proposed in this pull request:
Every command that uses the extension scaffolder (infra, upgrade, …) loads the SPDX text for the license in composer.json. Anything other than a known SPDX ID or exactly proprietary made it throw Cannot find module, e.g. "© Glowing Blue AG" or "PROPRIETARY". Licences are now matched against the SPDX list ignoring case, and any other value gives an empty licence text.

Reviewers should focus on:

  • A licence given as an array also gets no licence text, rather than using the first entry.

Screenshot
N/A

Necessity

  • Has the problem that is being solved here been clearly explained?
  • If applicable, have various options for solving this problem been considered? (N/A)
  • For core PRs, does this need to be in core, or could it be in an extension? (N/A)
  • Are we willing to maintain this for years / potentially forever?

Confirmed

  • Frontend changes: tested on a local Flarum installation. (The built CLI ran infra editorConfig on a copy of an extension with a free-form licence.)
  • Frontend changes: tests are green (run yarn test in js/).
  • Frontend changes: tests have been added, or are not appropriate here.
  • Backend changes: tests are green (run composer test). (N/A)
  • Backend changes: tests have been added, or are not appropriate here. (N/A)
  • Where applicable, changes are suitable for all supported database drivers (MySQL, MariaDB, PostgreSQL, SQLite). (N/A)
  • Core developer confirmed locally this works as intended.
  • The description above is written by me and describes what this pull request actually does.

@imorland
imorland marked this pull request as ready for review October 14, 2026 15:06
@imorland
imorland merged commit b589e42 into 3.x Oct 14, 2026
3 checks passed
@imorland
imorland deleted the im/unknown-licence branch October 14, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant