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.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new1.93 KB

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
project update bot’s picture

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

Rajeshreeputra made their first commit to this issue’s fork.

rajeshreeputra’s picture

Issue summary: View changes

Requesting review.

ankitv18’s picture

Status: Needs review » Reviewed & tested by the community

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

vipin.mittal18’s picture

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.

svenryen’s picture

Status: Reviewed & tested by the community » Needs work

@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.

rajeshreeputra’s picture

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.

rajeshreeputra’s picture

Status: Needs work » Needs review
vishal choudhary’s picture

Status: Needs review » Needs work
StatusFileSize
new162.62 KB

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

svenryen’s picture

@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.

deepakkm made their first commit to this issue’s fork.

rajeshreeputra’s picture

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

deepakkm’s picture

Status: Needs work » Needs review

@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.

svenryen’s picture

@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).

svenryen’s picture

@ 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?

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

rajeshreeputra’s picture

@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.

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

chandu7929’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new331.58 KB

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

vipin.mittal18’s picture

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!

svenryen’s picture

Status: Reviewed & tested by the community » Needs work

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.

redseujac’s picture

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.

hswong3i’s picture

Status: Needs work » Reviewed & tested by the community

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",
    }
...

asamoahboateng made their first commit to this issue’s fork.

svenryen’s picture

Status: Reviewed & tested by the community » Needs review
perrypierre’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new54.66 KB

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

ericvl’s picture

Status: Reviewed & tested by the community » Active

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 error if I run the Upgrade module 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

rajeshreeputra’s picture

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

ericvl’s picture

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.

ericvl’s picture

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

redseujac’s picture

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.

ericvl’s picture

Status: Active » Reviewed & tested by the community

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.

svenryen’s picture

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

svenryen’s picture

Status: Reviewed & tested by the community » Fixed
svenryen’s picture

Hi all!

Thanks again for the contribution in this issue. I've tagged a new release with some changes that have been in the dev branch for a while, as well as the crucial Drupal 11 readiness issues that were committed this week.

You can see a list of changes here:
https://www.drupal.org/project/eu_cookie_compliance/releases/8.x-1.25-rc1

I'd appreciate it if you can take the new version for a spin. Try removing cookies from a test site, play around with the settings and banner buttons and confirm that the new release doesn't break anything that worked before the update.

heddn’s picture

In #3380490: The core/js-cookie asset library is deprecated in Drupal 10.1.0 and will be removed in Drupal 11.0.0, 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?

redseujac’s picture

@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.

Status: Fixed » Closed (fixed)

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