Automated Drupal 11 compatibility fixes for eu_cookie_compliance

Created on 17 March 2024, 8 months ago
Updated 21 September 2024, about 2 months ago

Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 11.

Changes will periodically be added to this issue that remove deprecated API uses. To stop further changes from being posted, change the status to anything other than Active, Needs review, Needs work or Reviewed and tested by the community. Alternatively, you can remove the "ProjectUpdateBotD11" tag from the issue to stop the bot from posting updates.

The changes will be posted by the Project Update Bot โ†’ official user account. This account will not receive any issue credit contributions for itself or any company.

Proposed resolution

You have a few options for how to use this issue:

  1. Accept automated changes until this issue is closed

    If this issue is left open (status of Active, Needs review, Needs work or Reviewed and tested by the community) and the "ProjectUpdateBotD11" tag is left on this issue, new changes will be posted periodically if new deprecation fixes are needed.

    As the Drupal Rector project improves and is able to fix more deprecated API uses, the changes posted here will cover more of the deprecated API uses in the module.

    Patches and/or merge requests posted by others are ignored by the bot, and general human interactions in the issue do not stop the bot from posting updates, so feel free to use this issue to refine bot changes. The bot will still post new changes then if there is a change in the new generated patch compared to the changes that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated changes.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated changes, remove the "ProjectUpdateBotD11" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated changes again, add back the "ProjectUpdateBotD11" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful, they can close this issue (any status besides Active, Needs review, Needs work and Reviewed and tested by the community) and no more automated changes will be posted here.

    If the issue is reopened, then new automated changes will be posted.

    If you are using another issue(s) to work on Drupal 11 compatibility it would be very useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the latest patch in the comments by Project Update Bot โ†’ or human contributors that made it better.
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the patch, post an updated patch here.

Using the merge request

  1. Review the merge request and test it.
  2. Thoroughly test the changes. These changes are automatically generated so they haven't been tested manually or automatically.
  3. Provide feedback about how the testing went. If you can improve the merge request, create a new branch and merge request and work from there.

Warning: The 'project-update-bot-only' branch will always be overwritten. Do not work in that branch!

Providing feedback

If there are problems with one of the changes posted by the Project Update Bot โ†’ , such as it does not correctly replace a deprecation, you can file an issue in the Drupal Rector issue queue โ†’ . For other issues with the bot, for instance if the issue summary created by the bot is unclear, use the Project analysis issue queue โ†’ .

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

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

Merge Requests

Comments & Activities

  • Issue created by @Project Update Bot
  • This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module โ†’ , even with these changes, this module is not yet compatible with Drupal 11.

    Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.

    Therefore these changes did not update the info.yml file for Drupal 11 compatibility.

    Leaving this issue open, even after committing the current patch, will allow the Project Update Bot โ†’ to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

    Debug info

    Bot run #11-121090

    This patch was created using these packages:

    1. drupal/upgrade_status: 4.1.0
    2. mglaman/phpstan-drupal: 1.2.7
    3. palantirnet/drupal-rector: 0.20.1
  • Pipeline finished with Success
    8 months ago
    Total: 48s
    #121521
  • This comment was forced and has ignored the check if a change was already posted. This is only done when we want to update the issue without waiting for changes to happen.

    This is an automated patch generated using Upgrade Status and Drupal Rector. Please see the issue summary for more details. A merge request (MR) is also openend and updated.

    It is important that any automated tests available are run and that you manually test the changes.

    Drupal 11 Compatibility

    According to the Upgrade Status module โ†’ , even with these changes, this module is not yet compatible with Drupal 11.

    Currently Drupal Rector, version 0.20.1, cannot fix all Drupal 11 compatibility problems.

    Therefore, these changes did not update the info.yml file for Drupal 11 compatibility.

    The compatibility issues that Upgrade Status found after the Drupal Rector fixes were applied are attached to help you resolve them manually.

    Leaving this issue open, even after committing the current patch or merging the MR, will allow the Project Update Bot โ†’ to post additional Drupal 11 compatibility fixes as they become available in Drupal Rector.

    Debug information

    Bot run #11-137198

    These packages were used to generate the fixes:

    1. drupal/upgrade_status: 4.1.0
    2. mglaman/phpstan-drupal: 1.2.10
    3. palantirnet/drupal-rector: 0.20.1
  • First commit to issue fork.
  • Merge request !140Drupal 11 compatibility fixes. โ†’ (Open) created by rajeshreeputra
  • Pipeline finished with Success
    4 months ago
    Total: 50s
    #215532
  • Pipeline finished with Failed
    4 months ago
    #215535
  • Pipeline finished with Failed
    4 months ago
    #215534
  • Pipeline finished with Failed
    4 months ago
    #215537
  • Pipeline finished with Failed
    4 months ago
    #215538
  • Pipeline finished with Success
    4 months ago
    #215540
  • Pipeline finished with Success
    4 months ago
    Total: 51s
    #215612
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    Requesting review.

  • Status changed to RTBC 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ankitv18

    Changes looks good to me and MR is working with D11 application, hence marking this issue RTBC

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vipin.mittal18 Greater Noida

    Hello @svenryen & Miszel,

    It would be helpful if you could inform us when you intend to release a pre/stable version of eu_cookie_compliance as Drupal 11 stable is nearing its release date.

  • Pipeline finished with Success
    4 months ago
    Total: 50s
    #228536
  • Pipeline finished with Success
    4 months ago
    Total: 50s
    #228539
  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway svenryen

    @Pravin Gaikwad. Thanks for your contribution. I have some remarks, if these are resolved, we can consider accepting the Merge request.

    I see in #9e8ba1a9 that you've changed core_version_requirement to exclude Drupal 8.9.
    (https://git.drupalcode.org/project/eu-cookie-compliance/-/merge_requests...)
    I see that the usage of Drupal 8.9.x is at 29,738 websites as of July 6th, and we have around 56,007 sites that use version 8.x-1.x of this module. I would like to be able to continue supporting sites that are on versions 8.9, 9, 10 and 11 of Drupal. A possible scenario is that (although unlikely) we could come across a security issue at some point in the future, and with the restrictive core version requirement. It would then be challenging to effectively offer those who are using Drupal 8 a quick path to the new version. Requiring that people update to Drupal 9 in such a case may not be the best option.

    It should be possible to offer a soft dependency of https://www.drupal.org/project/js_cookie โ†’ so that those on Drupal 8 can continue using the core library and the later versions require the js_cookie module.

    I also see in #82398ac5 that the code makes an assumption that js_cookie has been downloaded but perhaps not enabled. How does the code handle the case where the js_cookie module hasn't been added to composer.json? At the least we should present the user with some message explaining that the js_cookie module needs to be added. I'm not sure if we have a pattern for this use case that we could adopt.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    Hey @svenryen,

    I agree with you on providing support for the EOL Drupal versions to ensure that customers with those versions can continue to use the module. Additionally, I'd like to propose an alternative approach to address this issue.

    Let's maintain the 1.x branch to support Drupal 8, 9, and 10 versions, ensuring broader compatibility.

    For the 2.x branch, we can focus on supporting Drupal 10 and 11 versions, aligning with the currently community-supported Drupal core versions.

    Looking for your opinion.

  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune
  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Vishal Choudhary Dharmshala

    I have been getting an Error when I check out in the MR: https://git.drupalcode.org/issue/eu_cookie_compliance-3430336/-/tree/343...
    in this branch, the module has not been configured and has given an error which is added in the Screenshot:

    So Need More work on this issue.
    Thanks

  • ๐Ÿ‡ณ๐Ÿ‡ดNorway svenryen

    @Rajeshreeputra I hear you, but there will take some time to deliver a version 2.0.x, and it won't be ready for Drupal 11 release unless somebody has a lot of time to devote to that task before August. Also taking into consideration, we want a complete rewrite of the JavaScript and other functionality in version 2.0.x.

    > Let's maintain the 1.x branch to support Drupal 8, 9, and 10 versions, ensuring broader compatibility.

    I would like to modify the merge request in this issue so as to support versions 8.9.x through 11. Anybody can work on this if you have time, or I will look into it before August.

  • First commit to issue fork.
  • Pipeline finished with Success
    4 months ago
    Total: 50s
    #231191
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    @svenryen could you please tag the issue needed for 2.x release will take a look and work on it.

  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia deepakkm

    @svenryen - fixed the above form issue and added D8 support back , as per comment #9 remaining fixes for D11 will be done in 2.0.x branch. Hence requesting review on this.

  • ๐Ÿ‡ณ๐Ÿ‡ดNorway svenryen

    @deepakkm and @mishradeepak1991, could you please help clarify what will happen if the js_cookie module isn't available?

    In D11, we shouldn't allow the module to work (so display some kind of notice about the lack of the js_cookie module) if the js_cookie module isn't there. At the same time, we probably shouldn't install the module in D8.9.x (if this is relevant).

  • ๐Ÿ‡ณ๐Ÿ‡ดNorway svenryen

    @ Rajeshreeputra:

    @svenryen could you please tag the issue needed for 2.x release

    Well there isn't a single issue for 2.0.x per se. Any contribution on 2.x would be appreciated. I can work with your team on that after my summer vacation (it's vacation time in Northern Europe).

    Any chance we can discuss involvement for D11 on Drupal Slack?

  • Pipeline finished with Success
    4 months ago
    Total: 141s
    #231765
  • Merge request !143Drupal 11 compatibility fixes. โ†’ (Open) created by rajeshreeputra
  • Pipeline finished with Success
    4 months ago
    Total: 50s
    #231767
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    Rajeshreeputra โ†’ changed the visibility of the branch 3430336-automated-drupal-11 to hidden.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    @svenryen I have created MR!143 and removed the dependency of core and contrib js_cookies library by including it. Please review. Validated the same with Drupal 8, 9, 10, 11 version and working as expected.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    Rajeshreeputra โ†’ changed the visibility of the branch 3430336-automated-drupal-11 to active.

  • Status changed to RTBC 4 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chandu7929 Pune

    I have verified MR #143 and changes looks good to me, hence RTBC.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia vipin.mittal18 Greater Noida

    Hello @svenryen,

    I hope you had a wonderful vacation! Just checking in to see if youโ€™re back and available to do stable release. Thanks!

  • Status changed to Needs work 3 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway svenryen

    Hi Rajeshreeputra, Vipin.mittal and Chandu and all!

    I haven't forgotten this, just been busy since coming back from vacation.

    This needs more work:

    Have you explored?https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21... ?

    I think it might be the best approach, so we can have a dependency on the library in D11 and not in the previous versions.

    I'll get back to you on this, hopefully this week.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium redseujac

    Please release a stable version for D11.

    For now D11 websites (as mine) must be run without cookie banner at all, thus infringing EU law and rules.

  • Status changed to RTBC 3 months ago
  • ๐Ÿ‡ญ๐Ÿ‡ฐHong Kong hswong3i

    Apply this MR for D11 now with:

    ...
        "repositories": {
            "https://packages.drupal.org/8": {
                "canonical": false,
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            },
            "https://drupal.org/node/3430336": {
                "canonical": false,
                "type": "vcs",
                "url": "https://git.drupalcode.org/issue/eu_cookie_compliance-3430336.git"
            },
        },
    ...
        "require": {
            "drupal/eu_cookie_compliance": "dev-3430336-Drupal-11-readiness",
        }
    ...
    
  • First commit to issue fork.
  • Pipeline finished with Success
    2 months ago
    Total: 50s
    #273736
  • Pipeline finished with Success
    2 months ago
    Total: 50s
    #273753
  • Pipeline finished with Success
    2 months ago
    Total: 49s
    #273757
  • Pipeline finished with Success
    2 months ago
    Total: 50s
    #275563
  • Pipeline finished with Success
    2 months ago
    Total: 48s
    #275669
  • Pipeline finished with Success
    2 months ago
    Total: 47s
    #275676
  • Status changed to Needs review 2 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ดNorway svenryen
  • Status changed to RTBC 2 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡ญGhana perrypierre

    I tested MR #145 with a new installation of Drupal 11, and it works as expected. No issues found during installation or testing.

  • Status changed to Active 2 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

    Only recently a new version of twig/twig is used in the core of Drupal 10.3 because of a security risk.

    This gives me the following erro if I run the Upgrade moduke under 10.3:
    Since twig/twig 3.12: Getting node "filter" on a "Twig\Node\Expression\FilterExpression" class is deprecated.

    Probably this error should also be fixed before it could run under Drupal 11.
    Therefor I've changed the Status back to Active.

    Greetings

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia rajeshreeputra Pune

    @ericvl could you please add more details or log trail. That would be more helpful.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

    This is what I use:
    - Drupal core 10.3.5
    - EU Cookie compliance 8x-1.24
    - Upgrade Status 4.3.5
    - PHP 8.2.12

    Install the Upgrade status module and look at admin/reports/upgrade-status.
    Select the checkbox besides the EU Cookie module and run only this scan with the button on the bottom.
    After scanning I'm getting 68 problems for this module.
    Most of them are on line 25 of vendor\symfony\deprecation-contracts\function.php and the error is:
    Since twig/twig 3.12: Getting node "filter" on a "Twig\Node\Expression\FilterExpression" class is deprecated

    There is nothing in the log trail.

    I think that the problem is in the update of the core from 10.3.3 to 10.3.4.
    Core 10.3.3 needed twig/twig ~v3.10.2 while core 10.3.4 needs twig/twig ~v3.14.0.

    I know that this issue should probably be reported in core but Upgrade Status has assigned this module to be the faulty one.
    Sorry if I wronly assigned this module to be responsible for the error but Upgrade Status is giving these eerors.
    Greetings and thank you for looking into this.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

    This could be a related issue. The errors could be generated by the Upgrade Status module.
    I say could be. I'm not sure.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium redseujac

    Well, I am working with Drupal core 11.0.4 and I installed manually EU Cookie Compliance 8.x.-1.24 after making it somehow compatible with D11.

    In eu_cookie_compliance.info.yml i have added || ^11 to core_version_requirement and did the same in composer.json.

    All is working properly without any error message nor warning in /admin/reports/dblog.

  • Status changed to RTBC about 2 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

    You are all right.
    This issue has nothing to do with this module.

    I ran the scan in Upgrade Status on other modules and themes and got the same result.
    The problem is in the core or in Upgrade Status. See the related issue in my previous comment.
    That is why I changed the status back to RTBC instead of Active.
    Sorry for the inconvenience.

  • ๐Ÿ‡ณ๐Ÿ‡ดNorway svenryen

    Thanks @ericvl. I should have tagged a RC some time today or tomorrow.

  • Pipeline finished with Success
    about 2 months ago
    Total: 111s
    #288983
  • Pipeline finished with Skipped
    about 2 months ago
    #288984
  • Status changed to Fixed about 2 months ago
  • heddn Nicaragua

    In ๐Ÿ“Œ The core/js-cookie asset library is deprecated in Drupal 10.1.0 and will be removed in Drupal 11.0.0 Active , we were working on a similar change in the 2.x branch. Can we pull out the bits from here appropriate for js_cookie and forward-port them over there?

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium redseujac

    @svenryen #41
    I have tested 8.x-1.25-rc1 in Drupal 11.0.4 and I can confirm that the new release does not break anything that worked before the update.
    Thank you.

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

Production build 0.71.5 2024