Drupal 10 compatibility

Created on 16 May 2023, over 1 year ago
Updated 20 September 2023, about 1 year ago

Problem/Motivation

Drupal 10 is the recommended and stable release by now, would you consider providing a new release?
I think there are fixes/changes involved though, cause after adding || ^10 in the info.yml and configuring the module, I see this error in the browser console: Uncaught TypeError: $(...).find(...).once is not a function, and the CSS class in not added anywhere.

Feature request
Status

RTBC

Version

2.0

Component

Code

Created by

🇮🇹Italy kopeboy Milan

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

Comments & Activities

  • Issue created by @kopeboy
  • 🇮🇹Italy kopeboy Milan

    Probably the same functionality could be achieved without requiring jQuery in D10?

  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States brotkel

    This didn't quite work, but I will have a new version that adds Drupal 10 compatibility out shortly. Thanks for filing the issue.

  • 🇺🇸United States brotkel

    Here's a patch that's a bit of a more comprehensive rewrite (removes all jQuery dependencies for pure Javascript) and adds D10 support for Composer. I don't have D10 up and running just yet, but it works in D9 and passes the code test in the official upgrade status module. As soon as this gets checked, I'd be happy to get it released.

  • Status changed to RTBC over 1 year ago
  • 🇪🇸Spain bmunslow

    Patch in #5 tested successfully. Applies cleanly too. Manually tested functionality of the toggle, it is correctly preserved between pages, and the right class is appended to the body as well.

    Setting this to RTBC since the patch is quite straightforward. A new release compatible with D10 will be much appreciated.

  • 🇪🇸Spain albeorte

    Patch #5 does not apply to version "8.x-2.0", however, it does apply to the "8.x-2.x" branch.

    I attach a compatible patch for version "8.x-2.0".

    I recommend that the changes be applied to the "8.x-2.x" branch and create a new release.

  • 🇪🇸Spain albeorte

    Sorry, I attached the file wrongly, I am attaching it again:

  • 🇷🇴Romania abautu

    For me, patch #8 fails to apply via composer (due to 2 lines in info.yml), so I created the attached one (which is essentially the same).

  • Assigned to rudam
  • 🇺🇸United States brotkel

    Thank you all for the testing. I've merged the changes into 2.x-dev and pushed a new 2.1 tag. @rudam could you please set 2.1 as the current recommended release?

  • 🇮🇳India harivenuv India

    Patch not working

    `data-dark-mode-switch` attribute not rendering in DOM due to that the JS throwing error, Tested in Drupal 10.2

Production build 0.71.5 2024