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:

  1. Easiest, but least flexible: let editor.module depend on file.module
  2. 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.

CommentFileSizeAuthor
#2 editor_depends_on_file-2119775-2.patch395 bytesWim Leers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

I 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 :)

Wim Leers’s picture

Title: EditorImageDialog assumes File module is enabled » EditorImageDialog assumes File module is enabled: add dependency on File module
Assigned: Unassigned » Wim Leers
Status: Active » Needs review
Issue tags: +sprint
FileSize
395 bytes

Wow! I didn't know that either — that's pretty convincing reasoning :) Thanks!

swentel’s picture

Status: Needs review » Reviewed & tested by the community
Wim Leers’s picture

That was … fast :D

Wim Leers’s picture

webchick’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Wim Leers’s picture

Issue tags: -sprint +CKEditor in core

Status: Fixed » Closed (fixed)

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