Class name issues in 1.4

Created on 25 October 2021, about 3 years ago
Updated 23 June 2023, over 1 year ago

Problem/Motivation

#2945002: Multilingual Icons: now just shown for English (patch provided) β†’ introduced some great enhancements for how class names are generated, but also introduced some bugs:

  1. Some of the additional icons introduced in #2920308: Additional Icons β†’ are no longer being rendered. This is because the code that sanitized the title was removed as part of the enhancements, so managedisplay and newdraft will never show up.
  2. Because the title sanitation code was removed, potentially invalid css classes are being generated.
  3. The final check in the if statement, elseif ($route_name = 'shortcut.set_switch') { is using a single equals sign instead of double, which results in any unknown icons being given the shortcut icon.

Remaining tasks

For #1, I updated the logic to look for the manage display route. For new draft, workbench moderation is just changing the label to New draft, so checking the route wouldn't work. Instead I checked against the translated "New draft" title, which should allow for this to keep working even in non-English sites. I also rendered the manage display icon for Layout manager since it's similar functionality and added support for Quick Node Clone to the clone if statement, since the old way of checking just titles would have caught that and rendered the clone icon.
For #2, I changed the logic a bit to render the sanitized route instead of the title. This was it fully makes the module multilingual friendly and fixes the sanitization issues.
For #3, I just fixed the if statement to use double equal signs.

The attached patch does the above.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jacobbell84

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

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States jacobbell84
  • @jacobbell84 opened merge request.
  • πŸ‡ΊπŸ‡ΈUnited States Rick Hood

    Hi,
    I am getting this error on composer update.
    Any ideas appreciated.
    Assuming it is something to do with this issue. Sorry it this is something wrong on my end.
    Thanks,
    Rick

      - Upgrading drupal/betterlt (2.0.0 => 2.0.1)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 1 install, 0 updates, 0 removals
    Gathering patches for root package.
    Gathering patches for dependencies. This might take a minute.
      - Installing drupal/betterlt (2.0.1): Extracting archive
      - Applying patches for drupal/betterlt
        https://git.drupalcode.org/project/betterlt/-/merge_requests/2.diff (Class name issues in 1.4)
       Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/project/betterlt/-/merge_requests/2.diff
    
    In PluginManager.php(274) : eval()'d code line 331:
    
      Cannot apply patch Class name issues in 1.4 (https://git.drupalcode.org/project/betterlt/-/merge_requests/2.diff)!
  • πŸ‡ΊπŸ‡ΈUnited States jacobbell84

    Hi Rick,
    That's actually my distro. It's not abandoned or paid, we've just been working on getting it cleaned up for release to the community. One of those things that started as more of an internal use for our agency that grew into something a little more. You must be working with one of our clients, if you need help with it I'm happy to assist, just shoot me a DM on the Drupal slack. It's unclear what version you're on, but the latest version of the distro targets the 2.0 branch of betterlt which fixed the above patch issue.

  • First commit to issue fork.
Production build 0.71.5 2024