Error: Call to undefined function Drupal\custom_breadcrumbs\file_url_transform_relative()

Created on 13 February 2023, over 1 year ago
Updated 8 March 2023, over 1 year ago

Problem/Motivation

When trying to use the module with drupal 10 following error is encountered

Error: Call to undefined function Drupal\custom_breadcrumbs\file_url_transform_relative() in Drupal\custom_breadcrumbs\BreadcrumbBuilder->applyBreadcrumb() (line 288 of modules/contrib/custom_breadcrumbs/src/BreadcrumbBuilder.php).

Steps to reproduce

  1. Setup a Drupal 10 site.
  2. Download the module either through git(branch 1.x) or install it from the dev release through composer composer require 'drupal/custom_breadcrumbs:1.x-dev@dev'
  3. Install the module.
  4. Setup a custom breadcrumb Content Entity for any content type.
  5. Save the configurations and clear the cache.
  6. Create a node of the same type and try to access it.
  7. Observe the error.

Proposed resolution

file_url_transform_relative() is not longer available in drupal 10. To use Drupal\Core\File\FileUrlGenerator::transformRelative() instead.

Remaining tasks

Test the patch on using the given steps.

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India arisen Goa

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

Comments & Activities

Production build 0.69.0 2024