Find a better solution to the unused Ctools dependency (for Starshot)

Created on 17 June 2024, 7 months ago
Updated 28 June 2024, 6 months ago

Problem/Motivation

tl;dr: Not only does Pathauto require Ctools despite not actually depending on it, it provides a workaround that's not appropriate for project templates like Starshot. A different solution would be preferable.

I'm not the first person (or the seventh) to point out that Pathauto declares a Composer dependency on Ctools even though it doesn't use it at all. (See previous issues below.) And I realize a workaround has been provided . But that workaround, involving the use of Composer's replace feature, is not appropriate for project templates where making that decision for users ahead of time would result in a very confusing situation if they ever try to composer require drupal/ctools and it does nothing. This is especially true for Starshot, which will be the recommended starting point for all new sites, and by extension a lot of users who 1) don't want unused code in production and 2) aren't necessarily experienced with Composer.

Downstream issue in Starshot

Track upstream issue for unused Pathauto dependency on Ctools · Issue #103 · phenaproxima/starshot-prototype

Previous issues

<!-- <h4 id="summary-steps-reproduce">Steps to reproduce</h4> -->

Proposed resolution

The most obvious solution would probably be to remove the dependency and bump the module version. It probably wouldn't be a bad time to move to semver anyway. If not, and your still worried about the undeclared dependency problem, perhaps you could remove the dependency and use a message in an update hook and/or admin notice.

Remaining tasks

<!-- <h3 id="summary-ui-changes">User interface changes</h3> --><!-- <h3 id="summary-api-changes">API changes</h3> --><!-- <h3 id="summary-data-model-changes">Data model changes</h3> -->
📌 Task
Status

Postponed

Version

1.0

Component

Code

Created by

🇺🇸United States traviscarden

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @traviscarden
  • 🇩🇰Denmark ressa Copenhagen

    Thanks for pursuing this @TravisCarden. Streamlining the Starshot experience is a great incentive to getting the Ctools module issue sorted out, and removed from Pathauto.

  • Status changed to Postponed 7 months ago
  • 🇨🇭Switzerland berdir Switzerland

    Having a module in the code base that's not enabled is a minor annoyance at best, you'll have plenty of non-enabled modules in the code base.

    Some of the previous issues are the ones where the actual work happened, yes, there have been 4-5 issues asking about this, but nothing was broken due to that, it's just low prio questions. Removing it is likely going to confuse dozens to hundreds of less experienced users that will get actual warnings and problems when upgrading. Pathauto has 300k installations on D8, and getting such an issue every few months is a price I'm happy to pay to avoid the alternative scenario.

    Yes, a 2.x release will then remove it, but I have no plans to create that any time soon and I won't do it only for that. ctools is still actively maintained and has a D11 compatible stable release already, so it doesn't block D11 adoption either. If that ever changes then I might push for the removal to happen but until then, this likely won't happen.

  • 🇺🇸United States traviscarden

    Thanks, @Berdir. Your position is perfectly understandable. I will share as a matter of documentation, that the biggest reason I care about unused code in production is that I've had to rush deployments before for security vulnerabilities in modules I wasn't using and didn't have installed, and that, of course, is a risk a prefer to avoid. But as I say, I respect your position, and I thank you for your work on such a critical module. 🙂

Production build 0.71.5 2024