Problem/Motivation

Hello project maintainers,

This is an automated issue to help make this module compatible with Drupal 10.

To read more about this effort by the Drupal Association, please read: The project update bot is being refreshed to support Drupal 10 readiness of contributed projects

Patches will periodically be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches 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 "ProjectUpdateBotD10" tag from the issue to stop the bot from posting updates.

The patches 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 patches 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 "ProjectUpdateBotD10" tag is left on this issue, new patches 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 patches 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 patches. The bot will still post new patches then if there is a change in the new generated patch compared to the patch that the bot posted last. Those changes are then up to humans to integrate.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecated API uses but then don't want new automated patches, remove the "ProjectUpdateBotD10" tag from the issue and use it like any other issue (the status does not matter then). If you want to receive automated patches again, add back the "ProjectUpdateBotD10" 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 patches will be posted here.

    If the issue is reopened, then new automated patches will be posted.

    If you are using another issue(s) to work on Drupal 10 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.

Providing feedback

If there are problems with one of the patches 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.74 KB

This is an automated patch generated by Drupal Rector. Please see the issue summary for more details.

It is important that any automated tests available are run with this patch and that you manually test this patch.

Drupal 10 Compatibility

According to the Upgrade Status module, even with this patch, this module is not yet compatible with Drupal 10.

Currently Drupal Rector, version 0.13.0, cannot fix all Drupal 10 compatibility problems.

This patch does not update the info.yml file for Drupal 10 compatibility.

Leaving this issue open, even after committing the current patch, will allow the Project Update Bot to post additional Drupal 10 compatibility fixes as they become available in Drupal Rector.

Debug info

Bot run #143

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.25
  2. palantirnet/drupal-rector: 0.13.0
kevinquillen’s picture

Issue summary: View changes

Beyond this, is there a Drupal 10 punchlist? How can I help?

project update bot’s picture

anybody’s picture

Priority: Normal » Major
Issue summary: View changes

Drupal 10 is close, any maintainer plans here?

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

grevil’s picture

Status: Needs review » Active

@kevinquillen here is D10 punch list for you :)

================================================================================
ZURB Foundation 6, --
Scanned on Tue, 12/20/2022 - 16:36

FILE: web/themes/custom/zurb_foundation-3304155/inc/zurb_foundation.drush.inc

STATUS         LINE                           MESSAGE
--------------------------------------------------------------------------------
Check manually 47   Call to deprecated function drupal_get_path(). Deprecated in
                    drupal:9.3.0 and is removed from drupal:10.0.0. Use
                    Drupal\Core\Extension\ExtensionPathResolver::getPath()
                    instead.
--------------------------------------------------------------------------------

FILE: web/themes/custom/zurb_foundation-3304155/zurb_foundation.theme

STATUS         LINE                           MESSAGE
--------------------------------------------------------------------------------
Check manually 291  Call to deprecated function drupal_get_path(). Deprecated in
                    drupal:9.3.0 and is removed from drupal:10.0.0. Use
                    Drupal\Core\Extension\ExtensionPathResolver::getPath()
                    instead.
--------------------------------------------------------------------------------
Check manually 306  Call to deprecated function drupal_get_path(). Deprecated in
                    drupal:9.3.0 and is removed from drupal:10.0.0. Use
                    Drupal\Core\Extension\ExtensionPathResolver::getPath()
                    instead.
--------------------------------------------------------------------------------

FILE: web/themes/custom/zurb_foundation-3304155/zurb_foundation.libraries.yml

STATUS         LINE                           MESSAGE
--------------------------------------------------------------------------------
Check manually 0    The 'global' library is depending on a deprecated library.
                    The core/jquery.once asset library is deprecated in Drupal
                    9.3.0 and will be removed in Drupal 10.0.0. Use the
                    core/once library instead. See
                    https://www.drupal.org/node/3158256
--------------------------------------------------------------------------------
Check manually 0    The 'status_in_reveal' library is depending on a deprecated
                    library. The core/jquery.once asset library is deprecated in
                    Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the
                    core/once library instead. See
                    https://www.drupal.org/node/3158256
--------------------------------------------------------------------------------
Check manually 0    The 'alert_close' library is depending on a deprecated
                    library. The core/jquery.once asset library is deprecated in
                    Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the
                    core/once library instead. See
                    https://www.drupal.org/node/3158256
--------------------------------------------------------------------------------

FILE: web/themes/custom/zurb_foundation-3304155/zurb_foundation.info.yml

STATUS         LINE                           MESSAGE
--------------------------------------------------------------------------------
Check manually 0    Value of core_version_requirement: ^8 || ^9 is not
                    compatible with the next major version of Drupal core. See
                    https://drupal.org/node/3070687.
--------------------------------------------------------------------------------

But this isn't really resolvable if we want to keep the Drupal 8 compability, as "Drupal\Core\Extension\ExtensionPathResolver" was introduced in Drupal 9.3.x. So I advise the maintainers to create a new dev release, where we can fix the Drupal 10 compability issues and release a new version of this theme having a minimum requirement of Drupal ^9.3

grevil’s picture

Status: Active » Needs review
anybody’s picture

@Grevil: We should have a new semver branch here to resolve this and introduce no BC issues.

kevinquillen’s picture

Agree with #9.

anybody’s picture

Fun-fact: We now reach 7.x or 8.x :D No idea what happens with that. Never reached this limit before.

Perhaps start with 9.x or 10.x?

kevinquillen’s picture

There is no semver on the project currently, right? Just the previous way it was done (Drupal major versions)?

That either leaves it with 1.0.x reset as other projects have done, or 9.0.0/10.0.0 (I guess?). If these changes work in both 9 and 10, I'd vote for 1.0.x reset, but I leave that to others.

anybody’s picture

Thanks @kevinquillen! Well I'm a bit unsure if composer and others will see a lower number as a newer release. Do you know about that?
So to be safe, my vote would be to have a 10.x branch referring to Drupal 10.

Are there any maintainers we should ask for that? Drupal 10 is out, so I think we should not wait too long (hours / days).

kevinquillen’s picture

Yeah the only confusing point with 10.x is that it still works on Drupal 9, right?

kevinquillen’s picture

@sim_1, thoughts?

anybody’s picture

Yeah the only confusing point with 10.x is that it still works on Drupal 9, right?

Well, it doesn't have to, we can also set ^10 and keep 8.x-6.x for Drupal 9.

grevil’s picture

I agree with @Anybody!

gnuget’s picture

Here an updated version of the patch.

gnuget’s picture

Status: Needs review » Needs work

Not listed here but the stable theme was marked as deprecated, and it was deleted on D10 and this theme depends of that theme.

name: ZURB Foundation 6
description: The most advanced responsive front-end framework in the world, now in Drupal! Based on Zurb Foundation version 6.x.
core_version_requirement: ^8.7.7 || ^9 || ^10
type: theme
base theme: stable

Wondering if this can just be changed to stable9 as a base theme but I guess that will require a good amount of testing right?

gnuget’s picture

I just found out that the stable theme is now a contrib theme:

https://www.drupal.org/project/stable

So, this might help to keep working this theme while the stable9 port is done.

I think the best thing to do for now is adding this contrib stable theme as a dependency of this theme while a new version is created.

grevil’s picture

Nice find @gnuget!

I also agree with using the stable contrib theme, as this is also recommended in the deprecation notice in https://www.drupal.org/node/3309392!

grevil’s picture

@gnuget, if you want to help to get up to speed here, consider doing the following:

Hopefully the maintainer agree on a new semver branch soon, and we get this stuff resolved! :)

sim_1’s picture

I think the steps @grevil outlined in #23 seem great!

As for the versioning question, my vote would be that we start by getting all the changes on the issue fork. Then we test updating on an existing d9 theme. If it's a smooth update then I don't think we need a new major version for these fixes.

If the changes aren't easily applied to d9 sites then I'm on board with a new major version and switching over to semver naming. With our current branch being 8.x-6.4, the next semver branch would be named 7.x, which I think is fine and will work with composer. But if people find that confusing we could jump up to 10x. But it doesn't have to mean that 10.x is related at all to the drupal version.

grevil’s picture

Thanks, @sim_1!

I think the original reason for a new semver branch was to avoid dropping the Drupal 8 support. But since its EOL is reached, I totally agree with you!

If @gnuget doesn't reply soon, I can implement / test the relevant changes! 🙂

gnuget’s picture

Yesterday I upgraded a site to D10 which uses this theme with success.

No big changes required to #20 just add the new contrib stable theme as dependency in the composer.json of the module and adjust the core_version_requirement to ^9.3 || ^10 and that's it.

I will upload a new patch later today.

Thanks for the help.

grevil’s picture

@gnuget, not to be mean, but that is simply not true! There are 3 occurrences of the old jquery "once" syntax in code and after applying the patch from #20, the module is installable for Drupal < 9.3 which will lead to errors.

grevil’s picture

Status: Needs work » Needs review

All done! Please review the provided MR! :)

anybody’s picture

Thanks @Grevil, MR!17 LGTM!

RTBC+1 - but I just reviewed the static code, didn't run a test. Someone should do that additionally to set this RTBC.

gnuget’s picture

Oh I thought it was just a matter of change the library in the libraries.yml file and the rest was the same, but it is a new function, duh!

Thanks Grevil.

Should the dependency be added in the composer.json file? that would automatically download the stable theme as soon as someone include this one in their project?

anybody’s picture

Should the dependency be added in the composer.json file? that would automatically download the stable theme as soon as someone include this one in their project?

Yes, please! Good idea :)

gnuget’s picture

Here a new patch adding the composer's dependency.

Also, this is how I tested it on my D9 site if someone needs a guide:

  1. Make sure that the site is ready using the upgrade status module
  2. Uninstall temporary the zurb_foundation theme:
    drush theme:uninstall zurb_foundation
    composer remove "drupal/zurb_foundation"
    
  3. Upgrade the site to D10
  4. Install the Composer Drupal Lenient plugin
  5. Add the theme in the drupal-lenient allowed list:
    composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/zurb_foundation"]'
    
  6. Add the new stable dependency, the zurb theme and reinstall it.
    composer require 'drupal/stable:^2.0'
    composer require 'drupal/zurb_foundation:6.x-dev@dev'
    drush theme:install zurb_foundation
    
  7. Finally, add this patch in the patches section and execute composer update --lock and that's it.
anybody’s picture

Thanks @gnuget!

Patches are so 2020 (for good reason :P). Please use the MR's instead. I've added the

"require": {
   "drupal/stable": "^2.0"
}

part.

Thanks for the additional information! :)

gnuget’s picture

I haven't contributed formally to Drupal in a few years hahahah , this Gitlab integration is too new to me 😅

I thought that I was going to need to create a new fork of Grevil's branch and then add my commit having two MR's open, In my mind was easier to me just add a new patch :-p

Knowing that I can just add commits on top of someone else's PR is good to know, Thanks!!!!

sim_1’s picture

I added this as a patch on a D9 site for testing and ran composer update drupal/zurb_foundation --with-dependencies. The patch applied cleanly (yay!), and the theme continued to build/look correct with a spot-check. However, I didn't see the contrib version of stable install. I'm wondering if that's because on D9 sites that namespace is already taken by the core version so D9 installs of this theme won't actually see that change. Can someone test on a D10 site, post their composer steps, and how it went?

tjtj’s picture

Please integrate this into the distribution. Patching in composer does not seem to work.

gnuget’s picture

As far as I know the dependencies are reported in the composer.json file but in the end the process that checks the dependencies is packagist.drupal.org repository.

So until this patch is committed the stable theme won’t be downloaded automatically as a dependency.

That is why the lenient composer plug-in is required to testing this, even doing the required changes in the module composer will refuse to install the module given that the requirements are read from the repository itself and not from the patches version of the module.

grevil’s picture

Status: Needs review » Needs work

@sim_1, interesting, that the module is installable under d9 without the contrib "stable" module!

I always thought, that adding a contrib module to the info.yml dependencies needs to be in the form of:

dependencies:
  - stable:stable

and adding a core module dependency in the form of:

dependencies:
  - drupal:stable

But seems they share the same namespace!

@gnuget did not know about the Lenient Composer Endpoint! Thanks for sharing this information! :)

I'll quickly recheck the compatibility with Drupal 9 and check the compatibility with Drupal 10!

EDIT (ISSUE IRRELEVANT!): Regarding the "Lenient Composer Endpoint" described in the link above, the way it is described there is actually DEPRECATED and does NOT work with Drupal 10! In the deprecation notice, it even references that site, but there is no information on about the incompatibility with Drupal 10 !

Instead of adding a "lenient" repository, you should instead require the mglaman/composer-drupal-lenient composer package and add the specific modules to the "lenient allow-list" using

composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/zurb_foundation"]'

I'll add this information to the docs.

grevil’s picture

Status: Needs work » Needs review

Alright! So I tried testing the composer functionality, but I guess this simply isn't possible.

I thought maybe requiring the "zurb_foundation" dev version via composer, applying this issue's MR as a diff inside the composer.json "patches" section and finally updating everything using composer update drupal/zurb_foundation -W would eventually lead to composer acknowledging the zurb_foundation composer changes that came through the patch, but I guess it will check the original composer dependencies first and then apply the patch, hence it doesn't notice the newly added "drupal/stable" contrib dependency.

What I can say is, that the theme is installable in Drupal 10 after manually requiring "drupal/stable". Maybe we should follow @Anybody's idea and create a new semver branch for a Drupal 10 only version? This way, we can make sure, that requiring this module in Drupal 9 won't lead to conflicts with the core "drupal/stable" theme?

grevil’s picture

@sim_1, @kevinquillen what do you think? Should we follow the suggestion by @kevinquillen in #13 and reset this module's version to 1.0.x?

kevinquillen’s picture

Has anyone seen other instances of using 1.x.x on other projects when they start using semver releases over the previous way?

sim_1’s picture

I did some digging and couldn't find any examples of people doing that. I think it's fine just to do it. If it doesn't work we'll push a 7.x.x semver branch instead I guess.

So does it sound right that we'll create a 1.x.x-dev branch to test on first. And then merge this patch in with that if it works successfully?

sim_1’s picture

StatusFileSize
new90.91 KB

Lol well I tried and it did not in fact work. I'm going to make a 7.0.x branch instead.

sim_1’s picture

Ok there should now be a 7.x-dev branch to start testing off of. I know it's a little confusing because we're also supporting D7 branches. If people think we should just bump it to 10x or something we can.

grevil’s picture

@sim_1 very nice! It might be, but I think that is fine! As long as we are getting this D10 ready. :)

grevil’s picture

Status: Needs review » Reviewed & tested by the community

Alright! Everything looks good to me!

One of the maintainer needs to change the target-branch of the MR to 7.x, and then we can safely merge this! I would still suggest creating a beta release.
Furthermore, as we can only test the composer.json once there is 7.x a release, I created this follow-up issue here: #3337939: [9.x] Test: Automatic requirement of the drupal contrib stable theme through composer.json.

grevil’s picture

I also checked if the code additions from #2850823: Turn off base theme css and js in sub themes by default would have any impact on the D10 compatibility, but they don't!

sim_1’s picture

Version: 8.x-6.x-dev » 7.x-dev

Ok, I'm going to try merging. I've changed the target in gitlab. My only fear right now is that last time i did this, the automatic contrib credit thing didn't work. So fingers crossed that goes smoothly!

sim_1’s picture

  • sim_1 committed 17e50e14 on 7.x authored by Anybody
    Issue #3304155 by Grevil, gnuget, Anybody, kevinquillen: Automated...
sim_1’s picture

Status: Reviewed & tested by the community » Fixed

Ok, I think that partially worked. @gnuget I tried to give you author credit, but because @anybody was the one to make the commit on the branch I guess it overwrote what I had selected in the checkboxes? If anyone knows a more foolproof way of doing this please let me know. I now think the only way to do it consistently is making and pushing the commit manually/with the command line.
- https://www.drupal.org/docs/develop/git/git-for-drupal-project-maintaine...
- https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquett...

Ok, marking this issue fixed. I'll make a beta release and then if someone has time to work on #3337939: [9.x] Test: Automatic requirement of the drupal contrib stable theme through composer.json that would great!

anybody’s picture

Thank you very much @sim_1!

Hum, just saw this on the module page:

And now I'm sadly quite convinced this is super confusing for users. :(
So I think we "have to" create 9.x instead of 7.x and should remove the 7.x branch. Otherwise this will cause UX-trouble, I guess. (Even if it doesn't cause technical issues.)

@Grevil and me are one company, so I think we're fine with the credits. I'll pass him a beer after work ;);)
Thank you! Nice to see this committed anyway!

sim_1’s picture

I think you're right. Ok, changed to a 9.0.0-beta1 release. yay! Nice working everyone getting this put together and tested!

kevinquillen’s picture

Nice work!

gnuget’s picture

Hi @sim_1

The credit appeared as expected in my profile all good from my side.

This is great news!

Thanks!!!

sim_1’s picture

Version: 7.x-dev » 9.x-dev
grevil’s picture

Great Stuff! Thanks everyone! :)

@sim_1 I got the credit as well, so all good on this end!

In my experience, the credit is given once the issue is set to "fixed". So only the credit setting on that very comment is important. Even if the credits will sometimes "reset" after the "fixed comment" is sent, it gets granted accordingly.

sim_1’s picture

I want to ask on this issue since it has the most visibility: How do we feel about keeping the D8 version as a recommended release? I feel fine (maybe after another week for some more testing) removing it from the recommended release list. I don't feel that we have the overall capacity to maintain both releases and I don't think there's much of a reason to. Do others agree?

anybody’s picture

@sim_1: Totally agree!

btw, zurb_foundation development seems pretty dead? But that's a different topic / issue...

kevinquillen’s picture

It does seem that way (Zurb co), but I think the best course of action is to get it Drupal 10 compatible and usable. That will give users a few years until Drupal 11 to change or make a decision on what to do.

Status: Fixed » Closed (fixed)

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