This bug happens only in PlaceholderFields in custom models.
When saving a plugin in PlaceholderAdmin the plugin icon_src()/icon_alt() is filtered by django escapejs which converts the hyphen to its unicode value, breaking the icon URL (https://github.com/divio/django-cms/blob/develop/cms/admin/placeholderadmin.py#L228)
Example to reproduce:
This is due the fact that cmsplugin-filer-image return as icon_src() the loaded image, but it's enough the below icon_src() definition in any plugin to show the bug:
def icon_src(self, instance):
return settings.STATIC_URL + u"cms/images/plugins/image-hyphened.png"
A test to demonstrate this will follow soon
Testcase for #1366. Created a testcase and a crafted plugin to demons…
…trate the issue
Added testcase for page objects for #1366. This issue doesn't apply t…
…o page-defined placeholders as codepath differs
Testcases added for both page-defined and custom model-defined placeholders. In the first case the issue is not present due to different codepath.
This issue occurs even when plugins are created directly into the placeholder; in this situation icon is not shown, so it's not apparent.
Awaiting further discussion before creating pull request with a fix.
@digi604 @ojii do you think you can push this in 2.3.1?
Removing escapejs from https://github.com/divio/django-cms/blob/develop/cms/admin/placeholderadmin.py#L228 should do no harm
PR Submitted to fix this
Ops, left open after merging