- Issue created by @Prachi6824
- ๐ฎ๐ณIndia sundaravigneshP
I have also face this same issue after cloned Coffee Zymphonies Theme like undefined function drupal_get_path().
Error: Call to undefined function drupal_get_path() in coffee_zymphonies_theme_get_slider_content() (line 176 of themes/contrib/coffee_zymphonies_theme/coffee_zymphonies_theme.theme).
Please open the coffee_zymphonies_theme.theme file in the path of (themes/contrib/coffee_zymphonies_theme/city_zymphonies_theme.theme ).
so please add the drupal_get_path() after end of this coffee_zymphonies_theme_get_slider_content function.function drupal_get_path($type, $name) {
/**
drupal_get_path('module', 'node') \Drupal::service('extension.list.module')->getPath('node')
drupal_get_path('theme', 'seven') \Drupal::service('extension.list.theme')->getPath('seven')
drupal_get_path('profile', 'standard') \Drupal::service('extension.list.profile')->getPath('standard')
*/
switch ($type) {
case 'module':
return \Drupal::service('extension.list.module')->getPath($name);
break;
case 'theme':
return \Drupal::service('extension.list.theme')->getPath($name);
break;
case 'profile':
return \Drupal::service('extension.list.profile')->getPath($name);
break;
return false;
}
}Its working fine for me,
- Status changed to Needs work
about 1 year ago 4:14pm 31 October 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
Since the theme uses
core_version_requirement: ^8 || ^9 || ^10
, simply replacing the function call with a call to a service method is not sufficient to resolve the bug, as Drupal 8.9 does not implement that service. - ๐ฎ๐ณIndia rushiraval
Rushikesh Raval โ made their first commit to this issueโs fork.
- @rushikesh-raval opened merge request.
- Status changed to Needs review
about 1 year ago 10:53am 2 November 2023 - Status changed to Needs work
about 1 year ago 11:41am 2 November 2023 - ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
In that case, the issue summary must be updated to describe all the necessary changes, and in which Drupal version the function, method, costant, or service has been deprecated.
- Status changed to Needs review
about 1 year ago 12:18pm 2 November 2023 The following files also have a dependency on classy theme, which is removed from Drupal10 core.
Most call
{{ attach_library('classy/file') }}
, but I haven't checked them all:web/themes/contrib/coffee_zymphonies_theme/templates/field/file-link.html.twig
web/themes/contrib/coffee_zymphonies_theme/templates/content/node.html.twig
web/themes/contrib/coffee_zymphonies_theme/templates/content/search-result.html.twig
web/themes/contrib/coffee_zymphonies_theme/templates/content/comment.html.twig
web/themes/contrib/coffee_zymphonies_theme/templates/dataset/forums.html.twig
web/themes/contrib/coffee_zymphonies_theme/templates/navigation/book-navigation.html.twig
web/themes/contrib/coffee_zymphonies_theme/templates/content-edit/image-widget.html.twig
web/themes/contrib/coffee_zymphonies_theme/templates/content-edit/file-managed-file.html.twig
web/themes/contrib/coffee_zymphonies_theme/templates/misc/status-messages.html.twig- ๐ฎ๐นItaly apaderno Brescia, ๐ฎ๐น
That will need a different issue.