After updating Drupal from 9.5.11 to 10.2.3 popups and CTA don't work.

Created on 1 March 2024, 4 months ago
Updated 16 March 2024, 3 months ago

Problem/Motivation

My website is under Drupal 9.5.11, I used upgrade_status and fixed all errors and finally could upgrade to Drupal 10.
The only issue I have is that my custom CTA buttons wont do anything, and my custom popups won't appear as well.
I suspect its due to js-cookie library but I cannot be sure. All the requirements are met in the server.

Steps to reproduce

Update Drupal 9.5.11 to Drupal 10* having custom CTA and popups.

πŸ’¬ Support request
Status

Fixed

Version

10.2 ✨

Component
JavascriptΒ  β†’

Last updated about 17 hours ago

Created by

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

Comments & Activities

  • Issue created by @thanosdk
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    What are CTA buttons?

    I can't tell if "custom CTA buttons" means you have custom code. But if you do you should show it for us to be able to provide any support.

    Have you looked at what the browser console is logging?

  • CTA means Call to Action, I suspect its due to jquery.cookie replaced with js-cookie. Before I upgrade to D10, upgrade_status reports:

    The 'global' library is depending on a deprecated library. The core/jquery.cookie asset library is deprecated in Drupal 9.0.0 and will be removed in Drupal 10.0.0. Use the core/js-cookie library instead.

    So I change in my module(s) core/jquery.cookie to core/js-cookie and upgrade_status does not complain anymore.

    I am able to upgrade to D10 without any problems but my buttons or popups dont work anymore.

    I have for example a button that when you click on it it shows a webform where you put your name and email and submit it.

    Those webforms wont open once in D10.

  • Status changed to Postponed: needs info 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States cilefen

    Below I am linking two articles about the deprecation. You probably must change your custom code too:

    https://www.drupal.org/node/3104677 β†’
    https://www.drupal.org/node/3322720 β†’ Note, the js-cookie library is deprecated in Drupal 10.

    Please read comment #2 above again and get all the information for support.

  • Thanks for helping.
    The error I got in console is: $.cookie is not a function

    the js-cookie library is deprecated in Drupal 10 indeed, but the module(s) depedencies had to be changed to js-cookie to be able to upgrade to D10.

    If its deprecated, what library do I have to use?

  • Status changed to Fixed 4 months ago
  • Finally fixed it, I had to change my module to point to the correct js.

    js:
    https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie...

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

Production build 0.69.0 2024