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

Periodically patches will be added to this issue that remove Drupal 10 deprecated API uses. To stop further patches from being posted simply close this issue (any status besides Active, Needs review or Needs work) or remove the "ProjectUpdateBotD10" 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 "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.

  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 don't want new automated patches simply leave this issue open but remove the "ProjectUpdateBotD10" tag from the issue.

    You can use Drupal Rector yourself to make these patches.

    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 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 10 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 Drupal 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”.

Issue fork danland-3296924

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
new3.13 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 #139

This patch was created using these packages:

  1. mglaman/phpstan-drupal: 1.1.24
  2. palantirnet/drupal-rector: 0.13.0
kiran.kadam911’s picture

Assigned: Unassigned » kiran.kadam911
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +DrupalMumbaiD10Readiness
kiran.kadam911’s picture

Assigned: kiran.kadam911 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.65 KB

The theme is compatible with D10 now.

sharayurajput’s picture

Assigned: Unassigned » sharayurajput

I will review this patch

sharayurajput’s picture

Status: Needs review » Needs work

Patch is not able to apply here
will provide a patch here

sharayurajput’s picture

Assigned: sharayurajput » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.66 KB
jcnventura’s picture

Status: Needs review » Needs work

That file_url_generator was only added in Drupal 9.3, so the minimum version is that one.

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

mmjvb’s picture

That would require to have multiple code sources. To avoid that you introduce new code when available.
Similar to how deprecations are introduced. You keep the `old` way and introduce the new way.
In this situation you test for the old function to exist and declare it implementing the new way otherwise.
Obviously, you document it to be refactored when minimum requirement changes.

ericvl’s picture

@mmjvb
IMHO Because version 8 was all ready end-of-life since november 2021, one need a new "major" version for the Danland theme without the capability to be installed on Drupal 8 (^9.3 | ^10).

genfoch01’s picture

I am using Danland in in production, can you give me a general date when a 9.5/10 compatible release will be available, so I can plan for my 9 -> 10 upgrade?

Thanks to all who support Danland.

GF

ericvl’s picture

I'm also using a theme that is based on the Danland theme.

The Danland theme is based on the "classy" theme and because this theme is now deprecated in version 9.5.0 and will be removed in Drupal 10, will this not be an issue when using Danland or a derived theme of Danland on Drupal 10???
Thanks for any reaction.

ericvl’s picture

As said before, Danland is based on the classy theme. Therefor one should install the substitute Classy when it will be removed in core 10+.
The theme is here Classy.

In the configuration of this contrib version there are 2 things to do:

- the base theme should be set to classy, and this is no problem in the Danland theme because it was allready there.
- a dependency should be added to Danland refering to classy:classy

This last thing is not included in the patches I found here.
Any reactions if this is the right way to go?

akshay kashyap’s picture

StatusFileSize
new3.72 KB
new82.19 KB

Hi Team, I have Port this Theme in drupal 9 and drupal 10 versions please check and review the code and apply the patch on the Drupal 10 setup.
Step to Find the Error on Drupal 10 Version
1. Drupal check command use to check the error.
COMMAND: vendor/mglaman/drupal-check/drupal-check themes/danland/

akshay kashyap’s picture

StatusFileSize
new3.72 KB

I have not added the base theme.
Now, I have added a base theme like Claro because classy is not supported in drupal10.

akshay kashyap’s picture

Status: Needs work » Needs review
akshay kashyap’s picture

StatusFileSize
new3.73 KB

Fixed Website encounter issue. Added patch again.

bunty oberoi’s picture

Status: Needs review » Needs work
StatusFileSize
new35.99 KB
new474.91 KB

Verified and tested Patch Comment #18 on drupal 10.1.x "warning: 1 line adds whitespace errors."

Testing Steps:-
1. Install drupal 10.1.x version.
2. git clone branch '8.x-1.x' danland.git
2. Applied Patch #18 /projects/drupal/themes/contrib/danland
3. Checked the changes difference using git diff
4. Installed theme and set it as default.

Testing result:
Danland Theme compatible with drupal 10.1.x
Here I have attached the screenshots.

Fix Drupal coding standards.

akshay kashyap’s picture

StatusFileSize
new4.01 KB

Fixed "warning: 1 line adds whitespace errors" Please review again.

akshay kashyap’s picture

Priority: Normal » Major
Status: Needs work » Needs review
bunty oberoi’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new36.1 KB
new474.91 KB

Thanks Akshay,
Applied Patch cleanly #20
Fixed Drupal coding standards. "warning: 1 line adds whitespace errors" Warning removed.
Here I have attached the screenshots.

bunty oberoi’s picture

bunty oberoi’s picture

jcnventura’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/danland.info.yml
    @@ -1,8 +1,8 @@
    -base theme: classy
    +base theme: claro
    

    Base should not be Claro

  2. +++ b/danland.info.yml
    @@ -1,8 +1,8 @@
    -core_version_requirement: ^8.8 || ^9
    +core_version_requirement: '^8 || ^9 || ^10'
    

    The file_url_generator used below requires Drupal 9.3

akshay kashyap’s picture

@jcnventura so can we select the base theme or use stable9.

akshay kashyap’s picture

StatusFileSize
new4 KB

I have created a patch to remove the base theme as claro and set the base theme to stable9
and change the core_version_requirement: ' ^9.3 || ^10' This theme will be compatible with Drupal 9.3 above and Drupal 10.

ericvl’s picture

A question before this patch is merged:

Shouldn't we need a composer.json in this project?
I know, it isn't strictly needed because this theme doesn't need any other "requirements" but it should be convenient for composer to work more smoothly. Especially to find out if this is a module or a theme. It can find this info under the "type" tag.
I have made sample that could be used:

{
  "name": "drupal/danland",
  "type": "drupal-theme",
  "description": "Provides Danland theme",
  "keywords": ["Drupal"],
  "license": "GPL-2.0+",
  "homepage": "https://www.drupal.org/project/danland",
  "minimum-stability": "dev",
  "support": {
    "issues": "https://www.drupal.org/project/issues/danland",
    "source": "https://git.drupalcode.org/project/danland"
  },
  "require": { }
}

As said, it is not stricly needed but convenient.
Greetings and thanks for the great work.

jcnventura’s picture

Status: Needs work » Needs review

@EricVL Can you please create a separate issue and add the composer.json there, please? Adding a composer.json has nothing to do with D10 support.

ericvl’s picture

@jcnventura

Sorry if I wronly have put it here but I thought it was a requirement of D10.
I've tried to install the theme without the composer.json file and it gave me an error. I don't know anymore what the error was but by adding the file, it was OK.
A new issue is made now.
Sorry again

djsagar’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new458.71 KB

I applied MR !2, which is working as expected, now i'm able to install theme in drupal 10.

RTBC ++

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

shubham_jain’s picture

As suggested by @jcnventura

The D10 issue should then make sure to add the D10 support to this file.

on this issue link:
https://www.drupal.org/project/danland/issues/3377042

Adding composer.json file.

shubham_jain’s picture

Status: Reviewed & tested by the community » Needs review
Bushra Shaikh’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new20.15 KB
new126.84 KB

I have reviewed and applied MR !2 this works for drupal 9.5 and drupal 10.0. and 10.0.1
Screenshots of the compatibility on 9.5 have been attached for reference:

Can be move to RTBC+1

jcnventura’s picture

Status: Reviewed & tested by the community » Needs work

I've committed #27 but there's still this code that is not doing what it was doing before:

diff --git a/danland.theme b/danland.theme
index 03464cc..6211118 100644
--- a/danland.theme
+++ b/danland.theme
@@ -63,8 +63,8 @@ function danland_preprocess_page(&$variables) {
   $variables['danland_bottom_b']['class'][] = 'in' . $bottom_b;
 
   $mask = '/\.(?:jp[e]?g|gif|png)$/i';
-  $files = \Drupal::service('file_system')->scanDirectory(drupal_get_path('theme', 'danland') . '/images/slideshows', $mask);
-  ksort($files);
+  $files = \Drupal::service('extension.list.theme')->getPath('danland') . '/images/slideshows' . $mask;
+  // ksort($files);
   $variables['files'] = $files;
   $variables['slideshow_display'] = theme_get_setting('slideshow_display', 'danland');
   $variables['slide1_url'] = theme_get_setting('slide1_url', 'danland');

Let's fix this so that a new release can be created.

jcnventura’s picture

Status: Needs work » Needs review
StatusFileSize
new704 bytes

Actually, the code for this provided by Project Bot in #2 should work just fine. Can someone please test it?

ericvl’s picture

@jcnventura
I'm using this modification you sugested in #40 for months and it works.
The Project Bot in #2 is right.

jcnventura’s picture

@EricVL, if you have tested, I invite you to mark it as "Reviewed & tested by the community". It will just stay here until someone does that.

And yes, I'm trusting whoever does that change that the theme actually works for them like that, so please make sure it does.

Once this code gets committed, I'll do a release, so if there's anything anyone wants in that release in all the issues that are marked "Needs Review", please go and test those and mark them RTBC as well, please :)

ericvl’s picture

Status: Needs review » Reviewed & tested by the community
ericvl’s picture

@jcnventura
To be very clear and having no misunderstandings: the patch in #40 should still be applied to the code before this issue should have the state "Fixed".
Thank you

ericvl’s picture

Hello,

I think, we should release a new version of this theme with only the modifications needed to make this theme Drupal 10 compatible because most of the modifications that are done in css on the dev branch are not fully tested and some do not even work properly.
Therefor it is probably better to make a new branch away from the 8.1_dev branch to make this possible if we do not want to wait for all the tests of the css modifications.
Just IMHO
Greetings

  • jcnventura committed 17bca8cf on 8.x-1.x
    Issue #3296924 by jcnventura, Project Update Bot, EricVL: Automated...
jcnventura’s picture

Status: Reviewed & tested by the community » Fixed
vojta’s picture

I'm sorry, I'm bit confused. Where do I get version working with Drupal 10.X? Or at least single patch to do this?

Status: Fixed » Closed (fixed)

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

Akshay kashyap changed the visibility of the branch 3296924-automated-drupal-10 to active.