Drupal 10 compatibility

Created on 30 January 2023, over 1 year ago
Updated 20 February 2024, 4 months ago

Problem/Motivation

The module is not compatible with Drupal 10. The motivation is to update the module so that it would be compatible with Drupal 10.

Steps to reproduce

  1. In order to verify the module's status, have the upgrade_status-module enabled.
  2. You can either check the module's issues with the manual scanning at admin/reports/upgrade-status or by running the following command on the module's folder: drush upgrade_status:analyze twig_extensions

As of this moment, there are 2 issues:

FILE: web/modules/contrib/twig_extensions/twig_extensions.info.yml

Value of core_version_requirement: ^8 || ^9 is not compatible with the next major version of Drupal core. See https://drupal.org/node/3070687.
FILE: web/modules/contrib/twig_extensions/composer.json

The drupal/core requirement is not compatible with the next major version of Drupal. Either remove it or update it to compatible. See https://drupal.org/node/2514612#s-drupal-9-compatibility.

Proposed resolution

List of the tasks:

  1. The necessary change is to update the core_version_requirement in twig_extensions.info.yml.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

๐Ÿ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ฎFinland jheinon_finland

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland jheinon_finland

    This patch should have the correct versions for the core_version_requirement.

  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland jheinon_finland

    And this patch has the fixed, along with the .

  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ฎFinland mErilainen

    Looks good to me. This will drop Drupal 8 compatibility, but it is not supported anymore anyway.

  • First commit to issue fork.
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States karolus

    Is further testing required, or is this good to go?

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands Arantxio Dordrecht

    Looking at the merge request, you are removing the twig/extensions requirement and then adding the twig/twig requirement. But shouldn't it be the other way around?
    Otherwise it doesn't change any code other than the required Drupal versions which should be fine. Twig has already been updated for D10 so this should be mergeable.

    I've also looked into the library that it fetches from twig/extensions. although this repo hasn't been updated in about 3 years the code doesn't seem to have any PHP deprecations with PHP 8.1 which is a requirement for D10. But it does state in that composer.json file that it needs: "php": "^7.1.3". But it doesn't seem to create a problem when fetching the libraries.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Libbna New Delhi, India

    When can we expect a stable release for d10 compatibility of this module?

  • ๐Ÿ‡ง๐Ÿ‡ทBrazil adrianopulz Florianรณpolis

    After updating tho this Fork in order to have D10 compatibility, I'm facing this error when trying to clear the cache.

    Service 'twig_extensions.twig.array' for consumer 'twig' does not implement Twig\Extension\ExtensionInterface.
    

    Backing tho the latest release version, the error stops. Any help with that?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom ecoluke

    I also get this after updating to this Fork for D10:

    Service 'twig_extensions.twig.array' for consumer 'twig' does not implement Twig\Extension\ExtensionInterface.

    But I can't get rid of it reverting the module :O

  • Status changed to Needs work 8 months ago
  • Based on everyone saying this doesn't work, switching back to needs work.

  • First commit to issue fork.
  • @paucala opened merge request.
  • ๐Ÿ‡ช๐Ÿ‡ธSpain paucala

    Sorry, i tried some commits but dosen't work either...

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chetan 11

    chetan 11 โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 8 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chetan 11
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chucksimply

    I can't even get past drupal-lenient to apply this patch (https://git.drupalcode.org/project/twig_extensions/-/merge_requests/3.patch).

    composer require drupal/twig_extensions:2.x-dev@dev -W

    outputs...

    Problem 1
        - twig/extensions[v1.3.0, ..., v1.4.1] require twig/twig ~1.20|~2.0 -> found twig/twig[v1.20.0, ..., 1.x-dev, v2.0.0, ..., 2.x-dev] but these were not loaded, likely because it conflicts with another require.
        - twig/extensions[v1.5.0, ..., 1.x-dev] require twig/twig ^1.27|^2.0 -> found twig/twig[v1.27.0, ..., 1.x-dev, v2.0.0, ..., 2.x-dev] but these were not loaded, likely because it conflicts with another require.
        - drupal/twig_extensions 2.x-dev is an alias of drupal/twig_extensions dev-2.x and thus requires it to be installed too.
        - drupal/twig_extensions dev-2.x requires twig/extensions ^1.3 -> satisfiable by twig/extensions[v1.3.0, ..., 1.x-dev].
        - Root composer.json requires drupal/twig_extensions 2.x-dev@dev -> satisfiable by drupal/twig_extensions[2.x-dev (alias of dev-2.x)].

    Would this be resolved if the commit was merged?

  • ๐Ÿ‡ฌ๐Ÿ‡ทGreece GiorgosK Chios, Greece ๐Ÿ‡ฌ๐Ÿ‡ท

    Was able to composer require
    fin composer require 'drupal/twig_extensions:2.x-dev@dev'
    and than add the latest merge request for patching
    uploading here for other people to link to (safer than the original patch URL)

    NOTE: the patch has nothing new and applies cleanly on latest dev

  • ๐Ÿ‡ฌ๐Ÿ‡ทGreece GiorgosK Chios, Greece ๐Ÿ‡ฌ๐Ÿ‡ท

    This did not work after all
    ended up with this after upgrading to drupal 10.1

    $ fin composer update
    Gathering patches for root package.
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - twig/twig[v2.0.0, ..., v2.12.5] require php ^7.0 -> your php version (8.1.21) does not satisfy that requirement.
        - Root composer.json requires drupal/core-recommended 10.1.6 -> satisfiable by drupal/core-recommended[10.1.6].
        - twig/extensions[v1.5.4, ..., 1.x-dev] require twig/twig ^1.27|^2.0 -> satisfiable by twig/twig[v1.27.0, ..., 1.x-dev, v2.0.0, ..., 2.x-dev].
        - You can only install one version of a package, so only one of these can be installed: twig/twig[v1.16.0, ..., 1.x-dev, v2.0.0, ..., 2.x-dev, v3.0.0-BETA1, ..., 3.x-dev].
        - drupal/core-recommended 10.1.6 requires twig/twig ~v3.6.0 -> satisfiable by twig/twig[v3.6.0, v3.6.1].
        - Root composer.json requires twig/extensions ^1.5.4 -> satisfiable by twig/extensions[v1.5.4, 1.x-dev].
    
    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
    
  • Status changed to Needs work 7 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chucksimply

    Yeah, looks like unless someone pushes changes to dev and tests, module will be problematic.

  • ๐Ÿ‡ถ๐Ÿ‡ฆQatar harivenuv Qatar

    Yes, not working for me too, patch should be merged. Really stuck here drupal-lenient not helped

    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Root composer.json requires drupal/twig_extensions 2.x-dev@dev -> satisfiable by drupal/twig_extensions[2.x-dev (alias of dev-2.x)].
        - drupal/core-recommended 10.2.0-beta1 requires drupal/core 10.2.0-beta1 -> satisfiable by drupal/core[10.2.0-beta1].
        - Conclusion: don't install drupal/core 10.2.0-beta1 (conflict analysis result)
        - drupal/core-recommended 10.2.0-rc1 requires drupal/core 10.2.0-rc1 -> satisfiable by drupal/core[10.2.0-rc1].
        - Conclusion: don't install drupal/core 10.2.0-rc1 (conflict analysis result)
        - drupal/core-recommended[10.1.7, ..., 10.1.x-dev] require twig/twig ~v3.6.0 -> satisfiable by twig/twig[v3.6.0, v3.6.1].
        - Conclusion: don't install twig/twig v3.6.1 (conflict analysis result)
        - drupal/core-recommended 10.2.0-alpha1 requires twig/twig ~v3.7.1 -> satisfiable by twig/twig[v3.7.1].
        - Conclusion: don't install twig/twig v3.7.1 (conflict analysis result)
        - drupal/core 10.2.x-dev conflicts with drush/drush <12.4.3.
        - drupal/core-recommended 10.2.x-dev requires drupal/core 10.2.x-dev -> satisfiable by drupal/core[10.2.x-dev].
        - Root composer.json requires drupal/core-recommended ^10.1.7 -> satisfiable by drupal/core-recommended[10.1.7, ..., 10.2.x-dev].
        - Root composer.json requires drush/drush ^11.0 -> satisfiable by drush/drush[11.0.0-rc1, ..., 11.x-dev].
    
    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
    Composer [update] failed, composer command failed: exit status 2. stderr=
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Prashant.c Dharamshala

    Prashant.c โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Prashant.c Dharamshala
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany Anybody Porta Westfalica

    Any plans to proceed here? Perhaps someone would like to contact the maintainer @joelpittet about future plans for this module?

    BTW I couldn't find any alternative to make advanced Twig functions like
    https://twig.symfony.com/doc/3.x/filters/format_currency.html
    https://twig.symfony.com/doc/3.x/filters/format_date.html

    work, which point out:

    The format_date filter is part of the IntlExtension which is not installed by default. Install it first:
    $ composer require twig/intl-extra
    Then, on Symfony projects, install the twig/extra-bundle:
    $ composer require twig/extra-bundle

    Otherwise, add the extension explicitly on the Twig environment:
    use Twig\Extra\Intl\IntlExtension;
    $twig = new \Twig\Environment(...);

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany Anybody Porta Westfalica
  • First commit to issue fork.
  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands ricovandevin

    I have contacted @joelpittet to see if we can get something merged so that we can proceed with this.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 5.3 & MySQL 5.5
    last update 2 months ago
    Patch Failed to Apply
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.2.1 + Environment: PHP 8.2 & MySQL 8 (--ignore-platfrom-reqs)
    last update 2 months ago
    Patch Failed to Apply
Production build 0.69.0 2024