It seems some good work was done in the Automated D9 fixes issue - But updating a site to D9 with this on it still does not work.

It still uses RouteEnhancerInterface and EntityManager. Both of which are deprecated.

I've attached a patch that fixes these issues. Note that I haven't done a test sweep yet. This just lets me move forward with the D9 updates.

CommentFileSizeAuthor
#58 scheduled_updates-3172330-MR2-7ad4d02--20230918-2.diff45.92 KBrecrit
#57 scheduled_updates-3172330-MR2--20230918-1.diff45.91 KBrecrit
#55 scheduled_updates-3172330-MR2-a37b9aff--20230905.diff45.57 KBrecrit
#46 3172330-46.patch24.28 KBjcnventura
#46 interdiff_31_46.txt7.45 KBjcnventura
#31 3172330-31.patch19.88 KBcantrellnm
#30 3172330-30.patch32.24 KBacbramley
#29 3172330-29.patch32.24 KBacbramley
#28 3172330-28.patch35.92 KBjoaopauloscho
#25 3172330-24.patch19.84 KBd70rr3s
#24 interdiff-23-24.txt268 bytesd70rr3s
#24 interdiff-23-24.patch268 bytesd70rr3s
#23 3172330-23.patch20.16 KBfeyp
#23 interdiff-3172330-22-23.txt2.93 KBfeyp
#22 interdiff-3172330-18-22.txt307 bytesacbramley
#22 3172330-22.patch17.81 KBacbramley
#18 d9-compatibility_3172330-18.patch18.17 KBhershey.k
#17 interdiff.txt549 byteshershey.k
#17 d9-compatibility_3172330-17.patch23.6 KBhershey.k
#16 scheduled_updates-deprecation-upgrade-status-report.txt14.45 KBhershey.k
#16 d9-compatibility_3172330-16.patch18.08 KBhershey.k
#16 interdiff.txt6.5 KBhershey.k
#15 d9-compatibility_3172330_14.patch12.32 KBdanielveza
#13 interdiff.txt511 bytesdanielveza
#13 d9-compatibility_3172330_13.patch11.9 KBdanielveza
#12 d9-compatibility_3172330_12.patch11.29 KBhershey.k
#11 d9-compatibility_3172330_11.patch9.49 KBwrd
#10 d9-compatibility_3172330_10.patch8.9 KBwrd
#9 d9-compatibility_3172330_9.patch6.26 KBhershey.k
#4 d9-compatibility_3172330_4.patch4.41 KBdanielveza
#2 d9-compatibility_3172330.patch3.3 KBdanielveza
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

DanielVeza created an issue. See original summary.

danielveza’s picture

StatusFileSize
new3.3 KB
danielveza’s picture

Status: Active » Needs review
danielveza’s picture

StatusFileSize
new4.41 KB

There was some more D9 incompatibility in the RouteSubscriber.

danielveza’s picture

Issue summary: View changes
wrd’s picture

I'm getting the following error when I enable the module:

PHP Fatal error: Trait 'Drupal\\Core\\Routing\\UrlGeneratorTrait' not found in /Users/foo/Sites/devdesktop/9.0/httpdocs/modules/contrib/scheduled_updates/src/Permissions.php on line 20, referer: https://drupal90.dd:8443/admin/modules

wrd’s picture

It looks to me as if both UrlGeneratorTrait and StringTranslationTrait are being pulled into Permissions.php without actually being used. Removing those lines seems to get me past that error, but then I start getting some errors regarding entity.manager, and trying to fix those gets me into a mess.

danielveza’s picture

Yeah - I've seen the same thing when going to the /admin/modules page.

Patching now.

hershey.k’s picture

StatusFileSize
new6.26 KB

@wrd you are correct it appears that the `UrlGeneratorTrait` isn't in use in the `Permissions.php` file, however the `StringTranslationTrait` I believe is being used by the `t()` method. Attached is an updated patch modified similar to patch #4 with the unused trait removed. Please test and let me know if you're still experiencing errors on D9.

wrd’s picture

StatusFileSize
new8.9 KB

This got me past the UrlGeneratorTrait error, but produced a new error:

Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: "You have requested a non-existent service "entity.manager"."

This patch includes the changes from #9, and changes references to entity.manager to entity_type.manager, and EntityManagerInterface to EntityTypeManagerInterface.

I can now enable the module without errors, but I haven't actually tested it beyond that yet.

wrd’s picture

StatusFileSize
new9.49 KB

And this just fixes a typo I found in the Config page link's descriptive text.

hershey.k’s picture

StatusFileSize
new11.29 KB

@wrd Good call with the additional entity manager references needing to be updated!

Attached is a patch adding to patches #10 and #11 updating the $entityManager variable name to $entityTypeManager in src/Plugin/Derivative/AddUpdateFieldLocalAction.php, and using snake case for the entity_type_manager parameter in the src/ScheduledUpdateTypeListBuilder.php constructor. For code consistency sake across module files.

danielveza’s picture

StatusFileSize
new11.9 KB
new511 bytes

Another one.

cacheUntilEntityChanges is deprecated.

joshua.boltz’s picture

I created issue (https://www.drupal.org/project/scheduled_updates/issues/3175938) to add the missing `core_version_requirement` line that is required for D9 support, but it was closed and noted that it should be addressed in this issue.

So, given that, this patch needs a re-roll to add the `core_version_requirement` line to the module's info.yml file:
https://www.drupal.org/node/3070687

...to make it fully D9 ready (in addition to the already addressed deprecation issues fixed in the current patch).

Without both the deprecations fixed and the `core_version_requirement` line, the module cannot be 100% D9 ready.

danielveza’s picture

StatusFileSize
new12.32 KB

The latest dev version actually already has the core_version_requirement key, which is why it's not in the patch. The issue it that is also still has the "core" key, which we need to remove.

hershey.k’s picture

Patch addresses additional deprecations revealed with upgrade_status module scan. See attached.

hershey.k’s picture

StatusFileSize
new23.6 KB
new549 bytes

Additional class namespace path error.

hershey.k’s picture

StatusFileSize
new18.17 KB

Mistakenly uploaded incorrect module version for patch #17 (it had contained two different patches in one). Corrected here.

joshua.boltz’s picture

Hmm looking at the #18 patch, I see it is now requiring Drupal console. That seems worriesome to me because there is currently no D9 support for Drupal console. There is an issue for it
https://www.drupal.org/project/drupal/issues/3146509
https://github.com/hechoendrupal/drupal-console/issues/4250

It's unclear if Drupal console is fully D9 supported yet or not. But just raising that in case.

hershey.k’s picture

@joshua.boltz drupal/console has been added as a requirement as the module extends the `ContainerAwareCommand` class from the plugin and therefor modules using scheduled_updates would throw a warning that the class isn't found if the plugin isn't installed.

As of v1.9.5 drupal/console is compatible with D9. See https://github.com/hechoendrupal/drupal-console/releases/tag/1.9.5.

joshua.boltz’s picture

Great thanks! I did not see that update, but glad it now has support.

acbramley’s picture

StatusFileSize
new17.81 KB
new307 bytes

Re #20 you do not need to add console as a requirement of this module just because there's a Command in there. Plenty of other modules have these commands but do not require the drupal/console package e.g Devel. Here's an updated patch with that change removed.

feyp’s picture

StatusFileSize
new2.93 KB
new20.16 KB

I tested patch #22 in Drupal 9.1.4 and as a result I created an updated patch:

  • Added config_export key to the annotation of Scheduled Update Type config entity. Otherwise you will get exceptions when trying to add new Scheduled Update Types.
  • Updated vendor name in composer.json to drupal.
  • Fixed two notices/warnings I got in PHP 7.4 on the way.
d70rr3s’s picture

StatusFileSize
new268 bytes
new268 bytes

Re-roll against latest dev on 1.x-dev (package naming on composer.json already fixed by maintainer)

d70rr3s’s picture

StatusFileSize
new19.84 KB

My bad wrong patch file.

arftdipto’s picture

I got the error Trait 'Drupal\Core\Routing\LinkGeneratorTrait' not found in modules/contrib/scheduled_updates.
Is there any fix for this ?

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

joaopauloscho’s picture

StatusFileSize
new35.92 KB

There was still some deprecated code, so I updated the patch.

acbramley’s picture

StatusFileSize
new32.24 KB

Re-rolled #28 so it applies correctly against alpha7

acbramley’s picture

StatusFileSize
new32.24 KB

Fixed the info.yml change on composer installed releases.

cantrellnm’s picture

StatusFileSize
new19.88 KB

Re-rolled again to work with the latest 8.x-1.x dev commit (as of 04 March, 2021).

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

ayalon’s picture

Status: Needs review » Reviewed & tested by the community

Hi and thanks for all the work done here!

This module was blocking us from upgrading to Drupal 9. So I forked the module and tested the patches available here extensivly with Drupal 9.

I created a merge request for the maintainer. I added some small additions I found but basically it's just a reroll of all contributions in this issue.

Hopefully we soon have a Drupal 9 compatible version ready!

redsky’s picture

Hi there, I just applied the patch and it solved the errors noted here for me. At least I am able to continue my D8 to D9 upgrade, I've not tested the functionality though. Just wanted to share my experience and offer my appreciation!

damondt’s picture

In the pull request #33 the test module info file should also have its constraints updated at /tests/modules/scheduled_updates_tests/scheduled_updates_tests.info.yml. I wouldn't consider that a blocker though.

For people trying the D9 upgrade you can add the following to the top of "repositories" in your composer.json:

    {
      "type": "vcs",
      "url": "https://git.drupalcode.org/issue/scheduled_updates-3172330.git"
    }

and then use the version constraint "drupal/scheduled_updates": "dev-3172330-module-is-not"

mattcoarr’s picture

Regarding @damondt's instructions for using the temp repository to bring in the d9 compatible version of scheduled_updates (which was a big help), I had to put the following in my composer.json to get it to work (particularly exclude drupal/scheduled_updates from the main drupal 8 repo):

    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8",
            "exclude": ["drupal/scheduled_updates"]
        },
        {
          "type": "vcs",
          "url": "https://git.drupalcode.org/issue/scheduled_updates-3172330.git",
          "only": ["drupal/scheduled_updates"]
        }

    ],

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

markie’s picture

Status: Reviewed & tested by the community » Needs work

Setting to needs work so tests will run.

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

deciphered’s picture

Pushed two missing fixes for the tests, may need more work still.

luksak’s picture

Works for me. Thanks a lot!

danthorne’s picture

Would be great to get a release now that D8 is EOL. How can I test this to help out?

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

jcnventura’s picture

Status: Needs work » Needs review

Added some changes namely:

  • composer.json: No need to duplicate the information already in the module's info.yml file.
  • scheduled_updates.info.yml: not sure if the module is now incompatible with Drupal < 8.7.7, so let's restore that to not break someone's site needlessly.
  • src/ClassUtilsTrait.php: Restore removed else condition
  • src/Plugin/Derivative/AddUpdateFieldLocalAction.php: Restore removed routeProvider class attribute
  • tests/modules/scheduled_updates_tests/scheduled_updates_tests.info.yml: no need to specify core requirement if package is Testing. This will allow module to be tested for Drupal 10.
  • etc: misc coding style fixes

One final word about my removal of the test dependency on roave/security-advisories.. This would make sense if the module maintainer wanted to keep informed about possible security issues. In practical terms, since the module only depends on Drupal core and modules, this makes absolutely no sense to use. Also, the maintainer seems to be AWOL.

jcnventura’s picture

StatusFileSize
new7.45 KB
new24.28 KB

And just in case someone wants to patch this, this is the current progress in the MR.

jcnventura’s picture

Title: Module is not D9 compatible » Drupal 9 compatibility fixes
mighty_webber’s picture

Priority: Normal » Major

Patches will not work because composer looks for compatibility before applying patches. These changes need to be pushed to the main repo before D8 EOL (upgraded to Major Priority as such).

It looks like the "test" areas of this module is what failed the checks. JCNVentura, are these failures what your latest push and patches fix? Are those patches part of the MR?

markie’s picture

@jcnventura can you apply that patch to MR-2 or create your own MR so composer can be over-ridden with the instructions given in #37 please.

mighty_webber’s picture

After attempting to patch in myself and rereading @jcnventura's comment, that patch provided in #46 is all the changes currently applied to the issue fork and issue branch.

As an alternative to #37 until this gets merged into the main branch, you can also set up your composer.json like such to point to the issue branch as the default place to pull the module from to get all the code with composer without having to deal with patch issues and D8 -> D9 versions.

{
    "repositories": {
        "drupal/scheduled_updates": {
            "type": "git",
            "url": "https://git.drupalcode.org/issue/scheduled_updates-3172330.git"
        }
    },
    "require": {
        "drupal/scheduled_updates": "dev-3172330-module-is-not",
    }
}
wrd-oaitsd’s picture

Patch #46 has been working well for us for a while now.

danthorne’s picture

Would be awesome to get this merged. More then happy to help with testing

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

recrit’s picture

Attached a static patch for consistent builds. The attached patch is MR 2 at the latest commit a37b9aff.

captain_haddock’s picture

Applied a37b9aff however, having issue

PHP Fatal error:  Declaration of Drupal\scheduled_updates\Routing\RouteSubscriber::getSubscribedEvents() must be compatible with Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array in /app/web/modules/contrib/scheduled_updates/src/Routing/RouteSubscriber.php on line 86

in D10

recrit’s picture

Title: Drupal 9 compatibility fixes » Drupal 10 compatibility fixes
StatusFileSize
new45.91 KB

@captain_haddock - That error is fixed in the latest MR and patch attached to this post.

recrit’s picture

StatusFileSize
new45.92 KB

static patch of MR2 attached with drush support for 11 and 12.

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

niklp’s picture

OT really but just a quick note for people upgrading to D10 that https://www.drupal.org/files/issues/2021-12-10/scheduled_updates-htmlspe... applies cleanly on top of the latest patch here and https://www.drupal.org/files/issues/2023-09-05/scheduled_updates-2872239... after that for the missing column error.

So, [latest patch here] then 2872239 then 3253884, on top of 1.x-dev

hchonov’s picture

Status: Needs review » Reviewed & tested by the community

This is ready to be committed. Please create a new major dev release. Since there are some test failures that do not seem to be caused by the D10 update of the module we would need a new issue to tackle them. Also I closed as duplicate #3363800: Drupal 10 compatibility so please give credits to the people that worked on the issue over there.

hchonov credited czigor.

hchonov credited fjgarcial.

hchonov credited murilohp.

hchonov credited sophiavs.

hchonov credited yuvania.

hchonov’s picture

hchonov’s picture

Version: 8.x-1.x-dev » 2.x-dev

Opened a new major branch 2.x where I will push this patch.

  • recrit authored 21eaac18 on 2.x
    Issue #3172330 by recrit, hershey.k, DanielVeza, jcnventura, acbramley,...
hchonov’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 2.x. Thank you all!

Status: Fixed » Closed (fixed)

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