Automated Drupal 10 compatibility fixes

Created on 18 July 2022, over 2 years ago
Updated 22 January 2024, 11 months ago

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โ€.

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akshay kashyap

    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/

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akshay kashyap

    Fixed Website encounter issue. Added patch again.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia bunty oberoi

    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.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akshay kashyap

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

  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia bunty oberoi

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

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡นPortugal jcnventura
    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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akshay kashyap

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akshay kashyap

    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.

  • Open on Drupal.org โ†’
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • @akshay-kashyap opened merge request.
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

    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.

  • Status changed to Needs review over 1 year ago
  • Open on Drupal.org โ†’
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • ๐Ÿ‡ต๐Ÿ‡นPortugal jcnventura

    @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.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

    @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

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.6
    last update over 1 year ago
    Composer require failure
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia djsagar

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

    RTBC ++

  • First commit to issue fork.
  • Open on Drupal.org โ†’
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shubham_jain

    As suggested by @jcnventura

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

    Adding composer.json file.

  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Bushra Shaikh

    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

  • ๐Ÿ‡ต๐Ÿ‡นPortugal jcnventura

    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.

  • Status changed to Needs work about 1 year ago
  • Status changed to Needs review about 1 year ago
  • Open on Drupal.org โ†’
    Core: 10.1.4 + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Waiting for branch to pass
  • ๐Ÿ‡ต๐Ÿ‡นPortugal jcnventura

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

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

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

  • ๐Ÿ‡ต๐Ÿ‡นPortugal jcnventura

    @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 :)

  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

    @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

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium ericvl

    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

  • Status changed to Fixed about 1 year ago
  • ๐Ÿ‡จ๐Ÿ‡ฟCzech Republic Vojta

    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?

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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Akshay kashyap

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

Production build 0.71.5 2024