When integrating the media browser into ckeditor using the CKEditor module instead of the WYSIWYG module, the browser settings that are set at admin/config/media/browser aren't respected. So, for example, if I configure only the "Upload" and "Library" plugins to be enabled, all tabs show up when I launch the browser from CKEditor. It seems that support for those settings were only built into the wysiwyg module support. Attached patch adds support for the CKEditor module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dobie_gillis’s picture

I applied this patch to media_wysiwyg version 7.x-2.0-alpha3+98-dev (in Panopoly 1.13), using CKEditor 7.x-1.16. It didn't seem to have any effect, so I resorted to just hiding the tabs I didn't want with CSS.

BrightBold’s picture

This worked for me, although it must require some cache clearing. When I first applied it it didn't fix it, and I followed dobie_gillis' advice and hid the extra tabs with CSS. But, when I came back to this issue a few days later to follow up, I now see that the tabs aren't present in the markup any more. So I'm thinking I failed to clear the cache after applying the patch and that's why the change didn't show up right away.

Zythyr’s picture

Clearing the cache still didn't fix the issue. I cleared both Drupal's cache and browser's cache.

I am using Ckeditor 7.x-1.16 and Media 7.x-2.0-alpha4+11-dev

Zythyr’s picture

It seems that the Ckeditor module is the issue.

I tested Ckeditor v4.4.6 using the Wysiwyg module, and that fixed the issue.

steinmb’s picture

Status: Needs review » Needs work

Patch no longer apply and needs to be rerolled and retested

git apply -v media_wysiwyg-ckeditor_module_browser_tabs-0.patch
Checking patch modules/media_wysiwyg/media_wysiwyg.module...
Hunk #1 succeeded at 228 (offset 40 lines).
Checking patch modules/media_wysiwyg/wysiwyg_plugins/media_ckeditor/library.js...
error: while searching for:
     */
    invoke: function (data, settings, instanceId) {
      if (data.format == 'html') {
        if (jQuery(data.node).is('.media-element')) {
          // Change the view mode for already-inserted media.
          var mediaFile = Drupal.media.filter.extract_file_info(jQuery(data.node));

error: patch failed: modules/media_wysiwyg/wysiwyg_plugins/media_ckeditor/library.js:13
error: modules/media_wysiwyg/wysiwyg_plugins/media_ckeditor/library.js: patch does not apply
izmeez’s picture

Looks like this issue still exists with ckeditor module and media.

izmeez’s picture

Status: Needs work » Needs review
FileSize
2.07 KB

Patch re-rolled against current 7.x-2.x applies and works as expected. May need to empty caches when applying.

aleksijohansson’s picture

Status: Needs review » Reviewed & tested by the community

Patch #7 seems to work fine! I had restricted WYSIWYG to only allow image file type and it was still showing all types of files. Now it's only showing images.

chiebert’s picture

+1 from me - the patch applies to 7.x-2.0-alpha4+37-dev (2015-Apr-24) and works as designed.

matthiasm11’s picture

+1 for patch #7.

  • Apply patch
  • Reconfigurate settings at /admin/config/media/browser
  • Clear caches
Dave Reid’s picture

Project: D7 Media » Media CKEditor
Version: 7.x-2.x-dev » 7.x-1.x-dev
Component: Media WYSIWYG » Code
Status: Reviewed & tested by the community » Needs work

We are deprecating the ckeditor integration and moving it to a separate module.

Dave Reid’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
a.henry’s picture

Patch re-rolled against current 7.x-2.x for media_ckeditor module.
Applies and works as expected. May need to empty caches when applying.

MediaFormat’s picture

Status: Needs work » Reviewed & tested by the community

Works with Media 7.x-2.x-dev

mkhamash’s picture

Also confirm this works with latest Media 7.x-2.x-dev, the tabs (Enabled browser plugins) works fine.

Though it would be nice to consider adding an allowed file extensions variable separate from the system wide "Default allowed file extensions" in "File settings" to limit uploaded files types since the current option "Allowed types in WYSIWYG" does not actually limit what can be uploaded, unless we are going to move the whole file type/extension thing #2533352: Rethink allowed extensions on field instance.

seanB’s picture

Patch works! Thnx!

The allowed file extensions for upload looks like a minor issue. I like the approach mentioned in https://www.drupal.org/node/2533352. The original issue seems fixed so I think it could be committed.

seanB’s picture

I updated the existing patch to fix the extension issue in https://www.drupal.org/node/2533326.

danyalejandro’s picture

Priority: Normal » Major

Requesting patch #13 to be commited, this is a major issue since the global tabs configuration is not being respected.

joseph.olstad’s picture

CKEditor integration has been moved to the Media CKEditor module

Patch 13 is actually for the media_ckeditor module now at http://www.drupal.org/project/media_ckeditor

however I did patch media with the first part of patch 13 to 'media' media_wysiwyg.js

http://cgit.drupalcode.org/media/commit/?id=7bdd246d6b3dece5ad4c19f571e0...

TODO: see patch 13 for media_ckeditor

joseph.olstad’s picture

Can someone please become maintainer of media_ckeditor and please commit this patch?

  • joseph.olstad committed 712d923 on 7.x-2.x authored by izmeez
    Issue #2333855 by izmeez, drclaw, a.henry: Media Browser Settings for "...
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

fixed in 7.x-2.x dev branch

Status: Fixed » Closed (fixed)

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