Replace deprecated drupal_get_path in CKEditorPlugin

Created on 17 August 2023, 11 months ago
Updated 5 September 2023, 10 months ago

After upgrading to Drupal 10 I got a white screen with this error when editing a text format:

Error: Call to undefined function Drupal\snippet_manager\Plugin\CKEditorPlugin\drupal_get_path() in Drupal\snippet_manager\Plugin\CKEditorPlugin\Snippet->getButtons() (line 51 of modules/contrib/snippet_manager/src/Plugin/CKEditorPlugin/Snippet.php).

The solution is to replace drupal_get_path() with \Drupal::service('extension.path.resolver')->getPath().

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States eeyorr

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

Comments & Activities

Production build 0.69.0 2024