Add support for Drupal 10 on 8.x-1.x branch

Created on 29 August 2023, 10 months ago
Updated 12 April 2024, 3 months ago

Problem/Motivation

I'm working on upgrading my site to Drupal 10, and I'm required to upgrade tb_megamenu from 8.x-1.x to 3.x. Given that there are major changes between the 8.x-1x and 3.x and given that 8.x-1.7 shows up as the recommended version by the maintainer on the project page (3.x is still on alpha), I would like to request an 8.x-1.x version compatible with Drupal 10.

Steps to reproduce

- Upgrade tb_megamenu from version 8.x-1.7 to 3.0.0-alpha2.
- Verify that your mega menu still works. In my case, I have to write extensive CSS to fix my main menu.

Proposed resolution

- Provide a 8.x-1.x version compatible with Drupal 10 so users like me can have more time to upgrade tb_megamenu.

Remaining tasks


- Update MR to be compatible with latest Drupal 8.x.

User interface changes

- None

API changes

- None

Data model changes

- None

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mmenavas

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

Merge Requests

Comments & Activities

  • Issue created by @mmenavas
  • πŸ‡ΊπŸ‡ΈUnited States themodularlab

    @mmenavas,

    Thanks for submitting this. Some background on this. We took over maintaining TB a few years ago. The 8.x branch is the legacy version of the module while the 2.x and 3.x are our versions. The 8.x is really only the "recommended" version because we don't yet have an official release for 2.x (d9) and 3.x (d10) yet. I'm not opposed to making 8.x Drupal 10 compatible as long as it still works for 8 and 9. At this point, we're really only supporting bug fixes and security issues for the 8.x branch.

    Another issue you will run into. In https://git.drupalcode.org/project/tb_megamenu/-/blob/8.x-1.x/src/Contro... on line 88, There's an issue where the usage of getContentTypeFormat() isn't compatible with Symfony 6. You have to use getContentType() instead. See https://git.drupalcode.org/project/tb_megamenu/-/commit/072b8dd984d98314.... That's the primary reason that we now have a 2.x and a 3.x branch, sadly.

    I'm happy to consider merging this and making 8.x compatible with 8, 9, and 10 but it will have to work for all those versions.

    One thing you could consider using is the Drupal Lenient β†’ to solve the D10 dependency issue, then you can rely on patches to address the remaining items until you are ready to move to the 3.x branch, which is WAY better by the way. :)

  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mmenavas
  • πŸ‡ΊπŸ‡ΈUnited States mmenavas

    @themodularlab: Thanks for the background info. Sorry I updated the status of this issue before seeing your comment. I think it makes sense to make the release compatible with Drupal 8 since the branch name is 8.x-1.x. Should the code be compatible with PHP 7.4 too?

  • Status changed to Needs work 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mmenavas
  • πŸ‡ΊπŸ‡ΈUnited States themodularlab

    Hmm good question. I think you have to be on 9 to use php 8. Might need to reconsider any support of 8.x at this point since it's been EOL for a bit now.

  • Status changed to Needs review 10 months ago
  • πŸ‡ΊπŸ‡ΈUnited States mmenavas

    Thanks for pointing out that D10 compatible modules should use getContentTypeFormat instead of getContentType. I pushed a commit to my MR to resolve this issue (the fixed is based on https://www.drupal.org/project/drupal/issues/3306886 β†’ ), Unfortunately my patch makes use of PHP 8 features that are not available in PHP 7, so that makes my patch only compatible with D9 and D10. Feel free to close the issue if you think any development/reviewing effort should be spent on making the 3.x stable. As you pointed out before, tb_megamenu users who still wish to use the 8.x-1.x branch on D10 sites can use the lenient composer plugin along with my patch.

  • πŸ‡ΊπŸ‡¦Ukraine Ruslan Piskarov Kiev, Ukraine

    Version 3.x has totally different html mockup and we aren't ready to refactor more 50 projects. We definitely need a patch for working 8.x-1.x with Drupal 10.

  • πŸ‡ΊπŸ‡ΈUnited States themodularlab

    Hi Ruslan Piskarov,

    See Comment #3 on this issue. If you use the Drupal Lenient composer package and then create patches to fix the issue referenced on #3 as well as patching the info file to allow for Drupal 10, then you should be good. That issue though currently prevents us from just setting the version requirements to 8, 9, and 10.

  • πŸ‡«πŸ‡·France Shenron_segamag

    Hi,

    I'm a little confused. Is it actually planned to release a patch to make 8.1-1.x with Drupal 10 ?

  • πŸ‡³πŸ‡±Netherlands BertVivie

    Hi somewhat confused too, I upgraded to drupal 10 on my dev machine and got almost everything working so almost ready to bring it to production
    I Installed tb_megamenu 3.x alpha2 because the 8.x version was not compatible with drupal 10.
    But with the 3.x version tb_megamenu on a normal screen works fine, only have to do some css to change background colors, but on an small (mobile) device it is very ugly and not working as supposed:
    Hovering and collapsing the submenu's doesn't work, the main menu's are much to high and on a mobile you can't scroll down so you only see the firste 2 items and not possible to collaps.

    My question: is 8.x ported to drupal 8, then I can reinstall version 8 again and install 3.x when it is production ready.
    Used tb_megamenu for over 10 yrs now from drupal 8 until drupal 9, do not like to leave this excelent menu system.

  • Status changed to Fixed 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States themodularlab
    • a161260f committed on 3383939
      Issue #3383939 by mmenavas, themodularlab: Add backwards compatibility...
    • e75f1aaf committed on bugfix/TBMM-3366359
      Merge branch '3.x' into bugfix/TBMM-3366359
      
      * 3.x:
        Issue #3383939 by...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024