civitheme composer install with D10 fails due to Drupal core version requirement

Created on 12 April 2023, over 1 year ago
Updated 14 December 2023, 11 months ago

Problem/Motivation

There is no pathway to update / install civic theme on Drupal 10

Steps to reproduce

  • Install the latest Drupal 10 recommended project composer template
  • Update linkit to resolve composer issues related to that module
  • attempt to install civic theme and you will get the following errors after attempting a composer install
 ddev composer require 'drupal/civictheme:^1.4'
./composer.json has been updated
Running composer update drupal/civictheme
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/components[2.0.0, ..., 2.4.0] require drupal/core ^8.7.7 || ^9 -> found drupal/core[8.7.7, ..., 8.9.20, 9.0.0, ..., 9.5.7] but the package is fixed to 10.0.7 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - drupal/civictheme[1.4.2, ..., 1.4.5] require drupal/components ^2 -> satisfiable by drupal/components[2.0.0, ..., 2.4.0].
    - Root composer.json requires drupal/civictheme ^1.4 -> satisfiable by drupal/civictheme[1.4.2, 1.4.3, 1.4.4, 1.4.5].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Proposed resolution

Composer requirements be updated to accommodate D10 compatibility.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.4

Component

Miscellaneous

Created by

🇦🇺Australia DJMyles

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

Comments & Activities

  • Issue created by @DJMyles
  • 🇮🇳India _pratik_ Banglore

    it seems drupal/component is not compatilble with d10.

  • 🇦🇺Australia DJMyles

    It's actually a bit of a rabbit hole this one.

    I forked civictheme and updated my forked version's composer.json.

    Turns out, when I resolve the Components issue, Webform now has an issue upstream itself with its own dependencies.

  • 🇦🇺Australia alex.skrypnyk Melbourne

    Here is a composer.json used to build D10 with the latest version of CivicTheme
    https://github.com/salsadigitalauorg/civictheme_source/blob/develop/comp...

    Please note that several modules require patching.

  • 🇦🇺Australia alex.skrypnyk Melbourne

    Just to clarify a bit more: CivicTheme relies on several contrib modules which may or may not be D10-ready; the CivicTheme dev team have no input into D10-readiness of those modules.

    However, we have provided a pathway to use D10 by adding several patches to your root composer.json. The link in my previous comment has all the required patches to copy into your project. Please note that our automation successfully builds several variants of D10 sites with CT installed on every commit, meaning that the set of provided patches works correctly.

    The proposed solution "Composer requirements be updated to accommodate D10 compatibility." will not work as it will break D9 compatibility: we cannot add patches to the CivicTheme's own composer.json for those contrib modules (and even if we would - those patches would not be used as patches only applied from the root of the site repository).

    Once D9 is EOL and all dependent contribs are D10 ready, the CivicTheme's composer.json will be updated to D10 dependencies.

  • 🇳🇿New Zealand luke.stewart

    After spotting this demo at DrupalSouth was trying to install to see if it would work on a D7 migration project with limited resource for design. .

    In case it's helpful to anyone else I've done the following to get it installed on D10.0:
    The projects for which Civictheme requires a version without D10 support all have some form of D10 release.
    linkit -> either 6.1.0-rc1 or 6.0.0-rc1
    components -> 3.0.0-beta3
    webform -> 6.2.0-beta6

    So we can use aliases to get these installed and then trick composer into thinking they are a supported version that Civictheme requires and cross our fingers and hope that the version increment doesn't break anything!

    I guess another way to do this would be to fork civictheme and then update the composer requirements to allow the above versions.

    For each project we first use composer show --all drupal/projectname to see what versions are on offer then pick the latest version that will support D10 and alias to the latest version that will match requirements in https://git.drupalcode.org/project/civictheme/-/blob/1.x/composer.json

    composer require 'drupal/webform:6.2.0-beta6 as 6.1'
    composer require 'drupal/components:3.0.0-beta3 as 2.4.0'

    Note - linkit will work for drupal 10.0 just not 10.1

    The only other fish hook is this theme depends on ckeditor4 - which doesn't exist in drupal core in D10 - however we can install the contrib module.

  • 🇦🇺Australia alex.skrypnyk Melbourne

    @luke.stewart

    could you please see #5 for a link to a working composer.json file for D10. It has all that is required to run CivicTheme on D10.

  • 🇦🇺Australia alex.skrypnyk Melbourne

    I've added a dedicated example composer.json file that can be used to start a consumer project

    https://github.com/salsadigitalauorg/civictheme_source/blob/develop/comp...

  • 🇳🇿New Zealand luke.stewart

    Thanks for the new composer.json

    It still looks like there are some additional requirements in the above that are not marked as requirements by the theme? Or am I not understanding something?

    (I'm trying to install based on drupal recommended so as not to hit issues with installing CiviCRM on top of the site, and to match our existing install structure.)

    Also trying to get my head around how this works.

    I'm assuming it would suffice for example to:

    create a new project using drupal recommended
    update composer.json to add repos for linkit, webform and components modules
    composer require drupal/ckeditor (because Drupal 10 has ckeditor5 which is named differently).
    then composer require drupal/civictheme (as per the instructions on the project page)

    (I've followed the above steps and just needed to manually install the required modules and seems to be working.)

    I am wondering about CKeditor versions - is it possible to just install CKEditor4 but use CKEditor5 from drupal core in text formats. I did spot one warning about a difference in how class styles should be included so perhaps not.

  • Status changed to Fixed about 1 year ago
  • 🇦🇺Australia alex.skrypnyk Melbourne

    This has been fixed in 1.5

    Please use the latest version of CivicTheme with supplied example composer.json file.

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

  • Status changed to Fixed 11 months ago
  • 🇦🇺Australia alex.skrypnyk Melbourne
Production build 0.71.5 2024