Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #0
Problem/Motivation
Not only does EditorImageDialog
assume that the File module (and its managed_file
element type), worse: the configuration form editor_image_upload_settings_form()
assumes it too!
This means that when the File module is disabled, the image uploading functionality will break. Instead, it should just be disabled.
Proposed resolution
Two options:
- Easiest, but least flexible: let editor.module depend on file.module
- Complex but most flexible: let editor.module detect whether file.module is enabled in every bit of code that is related to file uploads, and only when it is enabled, show that functionality and settings. This has repercussions for every text editor module (like ckeditor.module) though: it will have to detect whether
editor_image_upload_settings_form
returned anything at all, and if not, react accordingly.
Remaining tasks
TBD.
User interface changes
None.
API changes
None.
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#2 | editor_depends_on_file-2119775-2.patch | 395 bytes | Wim Leers |
Comments
Comment #1
swentel CreditAttribution: swentel commentedI would simply go for option 1. A one line patch vs a lot of moduleExists() checks and other things ...
Even the locale module depends on file - I didn't even know that until know, so let's keep it easy :)
Comment #2
Wim LeersWow! I didn't know that either — that's pretty convincing reasoning :) Thanks!
Comment #3
swentel CreditAttribution: swentel commentedComment #4
Wim LeersThat was … fast :D
Comment #5
Wim Leers2: editor_depends_on_file-2119775-2.patch queued for re-testing.
Comment #6
webchickCommitted and pushed to 8.x. Thanks!
Comment #7
Wim Leers