Hi,
I cannot delete filtered html caption value without changing format to plain text for an image embedded in a ckeditor enabled field like body field. You can update the html value for the field, but if you remove it, the value is unchanged when you look at the source
is left unchanged.

e.g.

[[{"fid":"7396","view_mode":"full","fields":{"format":"full","field_file_image_alt_text[und][0][value]":false,"field_file_image_title_text[und][0][value]":false,"field_caption[und][0][value]":"%3Cp%3EMedia%20browser%20Caption%3C%2Fp%3E","field_caption[und][0][format]":"filtered_html","field_credit[und][0][value]":"","field_classes[und][0][value]":"right"},"type":"media","field_deltas":{"1":{"format":"full","field_file_image_alt_text[und][0][value]":false,"field_file_image_title_text[und][0][value]":false,"field_caption[und][0][value]":"%3Cp%3EMedia%20browser%20Caption%3C%2Fp%3E","field_caption[und][0][format]":"filtered_html","field_credit[und][0][value]":"","field_classes[und][0][value]":"right"}},"attributes":{"height":"1500","width":"2250","style":"width: 350px; height: 233px; float: right;","class":"media-element file-full","data-delta":"1"}}]]

when changed to plain text and deleted you end up with:

[[{"fid":"7396","view_mode":"full","fields":{"format":"full","field_file_image_alt_text[und][0][value]":false,"field_file_image_title_text[und][0][value]":false,"field_caption[und][0][value]":"","field_caption[und][0][format]":"plain_text","field_credit[und][0][value]":"","field_classes[und][0][value]":"right"},"type":"media","field_deltas":{"1":{"format":"full","field_file_image_alt_text[und][0][value]":false,"field_file_image_title_text[und][0][value]":false,"field_caption[und][0][value]":"","field_caption[und][0][format]":"plain_text","field_credit[und][0][value]":"","field_classes[und][0][value]":"right"}},"attributes":{"height":"1500","width":"2250","style":"width: 350px; height: 233px; float: right;","class":"media-element file-full","data-delta":"1"}}]]
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

StephenRobinson created an issue. See original summary.

aaronpinero’s picture

I am having a similar problem with any field on an Image file that is embedded using ckeditor. So, I can change the value of the alt attribute, title attribute, and two other custom fields I added for images. However, I cannot make the fields blank (by deleting the content in the field) if I have previously added some text.

brockfanning’s picture

I haven't run into this, but can test it out. @aaronpinero and @StephenRobinson, are you using the CKEditor library via the WYSIWYG module, or via the Media CKEditor module?

brockfanning’s picture

Correction: I can recreate it in the Media CKEditor approach. Haven't tested it with the WYSIWYG approach.

brockfanning’s picture

Status: Active » Needs review
FileSize
816 bytes

Here's a patch that fixes it for me.

brockfanning’s picture

Component: Code » Media WYSIWYG
joseph.olstad’s picture

aaronpinero’s picture

@brockfanning I am using CKEditor version 4.4.8 with WYSIWYG version 7.x-2.2+76-dev

I ran into this problem once before with an earlier version of Media module. If I recall, the code was interpreting an empty string as no new value provided, rather than accounting for the possibility that an empty string was the new value.

joseph.olstad’s picture

@aaronpinero, have a look at @brockfannings' recipe , (in case you want to try his setup)
here's a link
https://www.drupal.org/files/media-ckeditor.make__7.yml

pay attention to the versions of media modules and its dependencies and libraries used in the recipe.

also, check the media installation page, might be helpful as well. There is also a recipe page
https://www.drupal.org/node/1298532

if you have a good recipe, feel free to add it, open a new ticket if you want help with your own custom recipe, let us know what versions of related modules you're using and which ones are enabled and we may at some point require configuration settings , steps to reproduce your setup.

aaronpinero’s picture

@joseph.olstad I'm sorry, I believe I indicated the specific versions of the modules involved when I reported I had encountered this issue. I will try this with the latest release of the media module (instead of the version of the module that was used in the original report -- beta 12) but I expect, based on the response received, that the error was not resolved.

joseph.olstad’s picture

7.x-2.0-rc1 is the latest version/release of the media module 7.x-2.x branch.

Status: Fixed » Closed (fixed)

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