Problem/Motivation

Remove drupal_get_path() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. Use \Drupal\Core\Extension\ExtensionPathResolver::getPathname() instead. See https://www.drupal.org/node/2940438

Steps to reproduce

Proposed resolution

/dropzonejs.install in dropzonejs_requirements() function

Switch to use $profile_path = \Drupal::service('extension.list.profile')->getPath(\Drupal::installProfile())

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Ada Hernandez created an issue. See original summary.

ada hernandez’s picture

Status: Active » Needs review
StatusFileSize
new681 bytes
heddn’s picture

Status: Needs review » Reviewed & tested by the community

No more calls to drupal_get_path exist.

berdir’s picture

Status: Reviewed & tested by the community » Needs work

This should then also update the required core version to 9.3

berdir’s picture

Title: drupal_get_path() is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0 » Drupal 10 compatibility, require Drupal 9.3
Status: Needs work » Needs review
StatusFileSize
new17.65 KB

Expanding the scope here, including patch from #3287067: Automated Drupal 10 compatibility fixes.

Needs JS changes as well, that will definitely need to be reviewed, especially the _.each replacement. But the JS test passes, so that's a start.

Also related #3264729: Use the new core FileUploadSanitizeNameEvent for sanitizing, this includes that event, but only as a minimal replacement of the existing file_munge_filename() call, it keeps the current hardcoded stuff.

berdir’s picture

Removed the debugging leftover and trying to explicitly specify the drupal core version in composer.json.

larowlan’s picture

+++ b/js/dropzone.media_library.js
@@ -11,7 +11,8 @@
+        Object.keys(drupalSettings.dropzonejs.instances).forEach( function (key) {
+          var item = drupalSettings.dropzonejs.instances[key];

+++ b/modules/eb_widget/js/dropzonejs_eb_widget.common.js
@@ -11,7 +11,8 @@
+        Object.keys(drupalSettings.dropzonejs.instances).forEach( function (key) {
+          var item = drupalSettings.dropzonejs.instances[key];

+++ b/modules/eb_widget/js/dropzonejs_eb_widget.ief_edit.js
@@ -11,7 +11,8 @@
+        Object.keys(drupalSettings.dropzonejs.instances).forEach( function (key) {
+          var item = drupalSettings.dropzonejs.instances[key];

Could just use Object.values here if you only need the 'item'

Looks good to me otherwise

Lots of legacy jQuery in those files that could probably be cleaned up, but that's out of scope here

berdir’s picture

That makes sense ;)

  • Berdir committed 9d0785e on 8.x-2.x
    Issue #3277296 by Berdir: Drupal 10 compatibility, require Drupal 9.3
    
berdir’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

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