Drupal 10 compatibility fixes

Created on 3 May 2023, about 1 year ago
Updated 26 October 2023, 8 months ago

Problem/Motivation

I attached a d10 upgrade patch to the parent ticket which was closed before d10 work was complete. I guess I'll attach the fix here also.

This patch makes 3 d10 compatibility changes suggested by rector.

โœจ Feature request
Status

Fixed

Version

1.1

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States Harry Slaughter Omaha NE USA

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

Comments & Activities

  • Issue created by @Harry Slaughter
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States Harry Slaughter Omaha NE USA
  • First commit to issue fork.
  • Assigned to dineshkumarbollu
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dineshkumarbollu

    vendor/bin/drush upgrade_status:analyze custom_breadcrumbs
    [notice] Processing /var/www/html/vbd9/web/modules/contrib/custom_breadcrumbs-3358046.

    ================================================================================
    Custom breadcrumbs, --
    Scanned on Thu, 05/04/2023 - 11:07

    FILE: web/modules/contrib/custom_breadcrumbs-3358046/src/BreadcrumbBuilder.php

    STATUS LINE MESSAGE
    --------------------------------------------------------------------------------
    Check manually 444 Relying on entity queries to check access by default is
    deprecated in drupal:9.2.0 and an error will be thrown from
    drupal:10.0.0. Call
    \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with
    TRUE or FALSE to specify whether access should be checked.
    --------------------------------------------------------------------------------

  • @dineshkumarbollu opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dineshkumarbollu

    Hi

    I created MR for this issue, also i am attaching screenshot of upgarde status report for D10 ready.

    please Review,

    Thanks

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States Harry Slaughter Omaha NE USA

    Previous patch was not formated properly.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
  • First commit to issue fork.
  • @snap_x opened merge request.
  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine snap_x

    Thanks for the patch @dineshkumarbollu for 1.x version. I tested it and it works fine for me. So I will change the issue status to RTBC.
    Looking forward for the new release.

    Thanks Harry Slaughter for 1.0.1 path. it is better to use dependency injection for FileUrlGenerator service. I created a new MR for 1.0.1 version with DI.

  • First commit to issue fork.
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine Foxy-vikvik
    The website encountered an unexpected error. Please try again later.
    ArgumentCountError: Too few arguments to function Drupal\custom_breadcrumbs\BreadcrumbBuilder::__construct(), 9 passed in /var/www/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 and exactly 10 expected in Drupal\custom_breadcrumbs\BreadcrumbBuilder->__construct() (line 137 of modules/contrib/custom_breadcrumbs/src/BreadcrumbBuilder.php).
    Drupal\custom_breadcrumbs\BreadcrumbBuilder->__construct(Object, Object, Object, Object, Object, Object, Object, Object, Object) (Line: 259)
    Drupal\Component\DependencyInjection\Container->createService(Array, 'beneva.breadcrumb') (Line: 177)

    Had that issue related to fileUrlGenerator
    Drupal 9.5 and PHP 8.1

  • Status changed to Needs review 12 months ago
  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine Foxy-vikvik

    I'm having trouble with the previous patch. Patch with the latest changes for the 1.0.1 branch
    I have added Null value in the BreadcrumbBuilder__construct()

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States branram

    Just curious, this version says it works with D10, but I'm running the latest (10.1.1) and it's saying this module isn't compatible. Is there something we need to do in order to use Custom Breadcrumbs with these later versions?

  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine Foxy-vikvik

    Did you use the lenient for installing custom_breadcrumbs module on Drupal 10?
    On 10.1.0 it is working well without any issues.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance notFloran Reims

    With Drupal 10 and the version 1.0.1 of the module the #13 patch is not working.

    I have the following error :

    TypeError: Drupal\custom_breadcrumbs\BreadcrumbBuilder::__construct(): Argument #10 ($fileUrlGenerator) must be of type ?Drupal\custom_breadcrumbs\FileUrlGeneratorInterface, Drupal\Core\File\FileUrlGenerator given, called in /xxxxx/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\custom_breadcrumbs\BreadcrumbBuilder->__construct() (line 136 of modules/contrib/custom_breadcrumbs/src/BreadcrumbBuilder.php). 
    

    Because the "use" for Drupal\Core\File\FileUrlGenerator is missing.

    I have edited the patch to fix the issue.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update 11 months ago
    Patch Failed to Apply
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States emptyvoid

    While running a update_status pass using phpstan the following notices were generated against the latest patched version.

    Custom breadcrumbs,  1.0.1
    Scanned on Thu, 07/27/2023 - 15:15
    
    FILE: modules/contrib/custom_breadcrumbs/src/BreadcrumbBuilder.php
    
    STATUS         LINE                           MESSAGE                           
    --------------------------------------------------------------------------------
    Check manually 284  Call to deprecated function file_url_transform_relative().  
                        Deprecated in drupal:9.3.0 and is removed from              
                        drupal:10.0.0. Use                                          
                        Drupal\Core\File\FileUrlGenerator::transformRelative()      
                        instead.                                                    
    --------------------------------------------------------------------------------
    Check manually 427  Relying on entity queries to check access by default is     
                        deprecated in drupal:9.2.0 and an error will be thrown from 
                        drupal:10.0.0. Call                                         
                        \Drupal\Core\Entity\Query\QueryInterface::accessCheck() with
                        TRUE or FALSE to specify whether access should be checked.  
    --------------------------------------------------------------------------------
    
    
  • Rishi Kulshreshtha โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States aaronpinero

    The patch in #16 applied cleanly using composer, fixed the compatibility of the module with D10 (as per upgrade status module) and seems to preserve the functionality of the module. So RTBC+1

  • Status changed to Needs work 10 months ago
  • ivnish Poland

    aaronpinero, the patch #16 can not apply, because some changes are already committed to dev. Needs reroll

  • First commit to issue fork.
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia pameeela

    Am I the only one finding the custom breadcrumbs aren't working in D10? Have a site using it just fine in D9 and with this latest MR for D10, I can't get even the simplest custom breadcrumb to work.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States malik.kotob

    malik.kotob โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    I have tested on Drupal 10.1 manually and works as expected, and tests are passing.

    Setting back to needs review - it looks like the only outstanding discussion is the deprecation notice.

  • Assigned to lamp5
  • ๐Ÿ‡ต๐Ÿ‡ฑPoland lamp5 Rzeszow
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States aitala

    Seems to work nicely on D 9.5.11

    Thanks,
    Eric

  • First commit to issue fork.
    • 70304404 committed on 1.x
      Issue #3358046 by colan: Fixed PHPCS errors.
      
    • 039b5c35 committed on 1.x
      Issue #3358046: Adjust deprecation warning messaging to reflect custom...
  • Status changed to Fixed 8 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada colan Toronto ๐Ÿ‡จ๐Ÿ‡ฆ

    Thanks all! See new release with DD10 support: https://www.drupal.org/project/custom_breadcrumbs/releases/1.1.0 โ†’

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

Production build 0.69.0 2024