Problem/Motivation

Hello project maintainers,
This is an automated issue to help make this module compatible with Drupal 9.

To read more about this effort by the Drupal Association, please read: Accelerating Drupal 9 module and theme readiness with automated patches

Periodically patches will be added to this issue that remove Drupal 9 deprecations. To stop further patches from being posted simply close this issue(any status besides Active, Needs Review or Needs work) or remove the "ProjectUpdateBotD9" tag from the issue.

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 or Needs work) and the "ProjectUpdateBotD9" tag is left on this issue, new patches will be posted periodically if new deprecations are needed.

    As the Drupal Rector project improves and is able to fix more deprecations the patches posted here will cover more of the deprecations in the module.

  2. Leave open but stop new automated patches.

    If you want to use this issue as a starting point to remove deprecations but don't want new automated patches simply leave this issue open but remove the "ProjectUpdateBotD9" from the issue.

    You can use Drupal Rector yourself to make these patches.

    If you want to receive automated patches again simply add back the "ProjectUpdateBotD9" tag.

  3. Close it and don't use it

    If the maintainers of this project don't find this issue useful they can simply close this issue(any status besides Active, Needs Review or Needs work) 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 9 compatibility it may be useful to other contributors to add those issues as "Related issues" when closing this issue.

Remaining tasks

Using the patches

  1. Apply the patch in the comment by Project Update Bot
  2. Thoroughly test the patch. These patches are automatically generated so they haven't been tested manually or automatically.

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 Rector issue queue. For other issues with the bot, for instance if the issue summary created by the bot is unclear,  use the Infrastructure project issue queue using the component “Bot: Drupal Rector”.

Comments

Project Update Bot created an issue. See original summary.

project update bot’s picture

Status: Active » Needs review
StatusFileSize
new1.39 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 9 Compatibility

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

Currently Drupal-Rector, version 0.5.5, cannot fix all Drupal 9 compatibility problems.

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

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

Debug info

Bot run #1477

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 0.12.3
  2. palantirnet/drupal-rector: 0.5.5
  3. rector/rector-prefixed: dev-master
andrey.troeglazov’s picture

Assigned: Unassigned » andrey.troeglazov
Issue summary: View changes
OCTOGONE.dev’s picture

I don't understand why this "must have admin theme" is not compatible with Drupal 9 yet. Please correct that ASAP!

andrey.troeglazov’s picture

I will roll a new release on this weekend. Dont panic :)

OCTOGONE.dev’s picture

That a good news!
And update with the new Drupal logo please.

klemendev’s picture

Good to hear this! :)

dasginganinja’s picture

Thanks! I'm interested in this as well.

phjou’s picture

+1

darvanen’s picture

Great to see this is in the pipeline, +1 to D9 compatibility...

A gentle reminder to folks that Drupal exists because of community involvement, almost every line of code is developed and provided for free. Instead of demanding, try offering to help, or if you can't help just provide encouragement. That is the Drupal way.

@andrey.troeglazov - do you need assistance with rolling out the new version?

indrajithkb’s picture

StatusFileSize
new30.83 KB

Hi I have tested with drupal 9.1.x-dev it's still not compatible with d9. Am attaching the screenshot after patch applied

after patch

Need to add the core_version_requirement

indrajithkb’s picture

Status: Needs review » Needs work
indrajithkb’s picture

Status: Needs work » Needs review
StatusFileSize
new358 bytes
new23.18 KB

Hi i have added the patch for this issue, please review.

Attaching screenshot after fix.

after fix

maenjuel’s picture

Wanted to create the same patch today, @Indrajith KB, but you were quicker ;)

I applied both patches, #2 and #13, and tested on Drupal 8 and 9. Worked with Drupal 8, but in Drupal 9 FILE_EXISTS_ERROR was removed. I updated the patch #2 accordingly.

Since EXISTS_ERROR, that is part of the patch, exists since 8.7.0, we have to update your patch as well, @Indrajith KB. And since "core_version_requirement" was only introduced in 8.7.7, I simply added that version as a requirement, and dropped "core: 8.x" from the file, that would guarantee compatibility for the versions between 8.7.x and 8.7.7.

maenjuel’s picture

StatusFileSize
new339 bytes

Just realized I added the second patch as a .diff file, sorry. Here is the same patch as a .patch file.

neclimdul’s picture

That constant isn't quite right, its not global its on the FileSystemInterface. Additionally, rector didn't pick it up but file_unmanaged_copy is removed as well. Here's an updated patch that worked for me. I combined the service retrieval since its used in both cases of the if statement.

Additionally, you only need to specify ^8 in the supported versions. Prior to that the line just gets ignored so there's not reason to be that specific.

I combined the two patches using format-patches. If you're not familiar with it you can read more about applying them here but git apply will also handle it just fine.

neclimdul’s picture

StatusFileSize
new1.15 KB
new3.03 KB

bah, files didn't get uploaded.

indrajithkb’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new30.86 KB
new23.07 KB

Hi @neclimdul nice work it's fixing our problem...!!!

attaching screenshots

before:

before patch

after:

after patch

klemendev’s picture

Any plans to release these patches in a release?

satyaki_dutta’s picture

StatusFileSize
new1.88 KB

please review the patch made on report from upgrade_status module.

artusamak’s picture

I confirm that #16 works for D9 and satisfies Upgrade status module.

gobinathm’s picture

StatusFileSize
new478.24 KB

Reconforming the manul test

Installation: Patched Successfully via Composer Patch workflow

Functional Test: No issues identified

bryandenijs’s picture

@satyaki_dutta What is exactly difference between your patch and the patch from #16?
I think the #16 works fine and is better than the #20 patch.

Hope there will be a new release soon so there won't be a composer issue anymore when upgrading to D9:

$ composer update
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove drupal/adminimal_theme dev-1.x
    - Conclusion: don't install drupal/core 9.0.3
......
    - drupal/adminimal_theme dev-1.x requires drupal/core ~8.0 -> satisfiable by drupal/core[8.0.x-dev, 8.1.x-dev, 8.2.x-dev, 8.3.x-dev, 8.4.x-dev, 8.5.x-dev, 8.7.x-dev, 8.8.x-dev, 8.9.x-dev].
......
pavelculacov’s picture

Composer Update Patch working only for #20 File #16 not working

klemendev’s picture

Confirming #20 seems to work

johnpitcairn’s picture

Status: Reviewed & tested by the community » Needs work

Patch at #16 does not apply to current dev.

johnpitcairn’s picture

Assigned: andrey.troeglazov » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.72 KB

This patch is practically the same as #16, but will apply to current dev via composer patches, git apply or plain old patch. Note it restores the core: 8.x line which is commented out in dev for some reason, I believe this defines the minimum core version required, is more easily parsed than core_version_requirement, and may remain present (correct me if I am wrong).

johnpitcairn’s picture

StatusFileSize
new1.92 KB

Hmm ... think that dev version I used with the commented-out core requirement was old (23 May), the result of downloading the .tar.gz. Try this patch against 1.5 or current dev (via composer or git checkout) instead.

johnpitcairn’s picture

jcnventura’s picture

@John Pitcairn, it would be nice if you could provide an interdiff between #16 and #28 then.

promes’s picture

I installed this version + patch #28 yesterday and only found a missing file: /themes/adminimal_theme/logo.svg.
The name of the site is hardly visible: a link in a black background.

johnpitcairn’s picture

StatusFileSize
new2.8 KB

@jcnventura: Here's an interdiff, for what it's worth. The patch is more readable than the interdiff. It's basically a re-roll, #16 (actually #17) has a bunch of email cruft in it, which is presumably what prevents it applying for me.

hideaway’s picture

I just would like to ask if this is going to be merged anytime soon with a new released version of adminimal theme. This issue is kind of blocking us for three months already from being able to upgrade to Drupal 9.

orlando.thoeny’s picture

FYI if you want to work around Composer prohibiting you to update to Drupal 9 you can do it by changing your composer.json and use the patch provided here.

https://medium.com/@orlando.thoeny/drupal-9-fix-composer-modules-prohibiting-upgrade-6f3452849411

andypost’s picture

Status: Needs review » Needs work
+++ b/adminimal_theme.theme
@@ -50,20 +51,22 @@ function adminimal_theme_form_system_theme_settings_alter(&$form, \Drupal\Core\F
-      file_unmanaged_copy($old_css_path, $custom_css_path, FILE_EXISTS_ERROR);
+      $file_system->copy($old_css_path, $custom_css_path, FileSystemInterface::EXISTS_ERROR);
...
-      file_unmanaged_save_data("", $custom_css_path, FILE_EXISTS_ERROR);
+      $file_system->saveData("", $custom_css_path, FileSystemInterface::EXISTS_ERROR);

https://www.drupal.org/node/3006851

both require ^8.7 so ^8 is not true

andypost’s picture

I suggest to remove "core: 8.x" at all for core_version_requirement: ^8.8 || ^9

..and create new release as core 8.7 no longer supported

Ref https://www.drupal.org/node/3070687

jcnventura’s picture

Agree with @andypost, It's not possible to specify ^8.7 - only ^8.7.7 - so we might as well specify ^8.8 (or ^8.7.7). In any case that line needs to be changed.

fabsgugu’s picture

Status: Needs work » Needs review
StatusFileSize
new1.92 KB

Hello, I rectified the patch.

jcnventura’s picture

Status: Needs review » Needs work

@Fabsgugu can you create a real patch and not simply editing the file from #28. The patch you provided is invalid.

fabsgugu’s picture

Status: Needs work » Needs review
StatusFileSize
new1.92 KB
joshua.boltz’s picture

We are currently using the 8.x-1.3 version. I tried applying the latest patch here, but it did not apply.
I also tried updating to latest 8.x-1.5 and applying the patch, and that didn't work either.

I'm also a little confused by this patch, because when i run Drupal check before the patch, I see no D9 deprecation issues, yet there are still some being fixed in this patch. The main part of this patch I think I need for D9 support is the addition of the `core_version_requirement`, but perhaps Drupal-check was wrong and/or missed some deprecations, so I would use this patch if it would apply. Or is it possible those deprecations were fixed and committed already in some other issue?

darvanen’s picture

@joshua.boltz patches are usually created against the dev branch of a module in the first instance. You can check the primary branch for the issue in the metadata section.

eugene_bsk’s picture

I would add a fix code standard

./vendor/bin/rector process web/modules/contrib/adminimal_theme
Rector 0.8.x-dev@8896f0a
Config file: rector.yml

3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] Rector is done!

eugene_bsk’s picture

I would add a fix of code standard

Rector 0.8.x-dev@8896f0a
Config file: rector.yml

3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] Rector is done!

ysamoylenko’s picture

Status: Needs review » Reviewed & tested by the community

Hello everyone.
The #43 looks good for me.
Please commit the changes.

andrey.troeglazov’s picture

Assigned: Unassigned » andrey.troeglazov
andrey.troeglazov’s picture

  • Eugene Bsk authored 3c2e64b on 8.x-1.x
    Issue #3146068 by Eugene Bsk, maenjuel, John Pitcairn, Fabsgugu,...
andrey.troeglazov’s picture

Assigned: andrey.troeglazov » Unassigned
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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