editing of nested plugins breaks when STATIC_URL changes #1129

Closed
m000 opened this Issue Dec 30, 2011 · 9 comments

Projects

None yet

4 participants

@m000
m000 commented Dec 30, 2011

I noticed that when you change your STATIC_URL in your django configuration then the plugin instances which are nested inside some text plugin become uneditable from the admin.

The reason is that that the location of the plugin placeholder icon is stored in the database with the expanded value of STATIC_URL at the time the plugin was created. E.g. <img src="/static/cms/images/plugins/link.png" alt="my link" id="plugin_obj_4" title="my link"/>.

As a result relocating your STATIC_URL becomes a messy process.

@ojii
Collaborator
ojii commented Dec 30, 2011

looks like a documentation issue if anything to me

@m000
m000 commented Dec 30, 2011

While it would be good to have a note about this somewhere in the documentation, I hardly find it a documentation issue.

This makes it harder for people to reconfigure their site at will, which doesn't sound right. Site settings are meant to be changed, so although STATIC_URL is not expected to change often, it should not be treated as immutable.

I understand that the issue is not very urgent, but I think it should be fixed sooner or later.

@m000
m000 commented Dec 30, 2011

Given that STATIC_URL doesn't change often fixing this dynamically (e.g. have javascript replace STATIC_URL with the actual path when editing the plugin and the inverse when saving the the plugin) would probably not worth the extra effort.

Would it be an acceptable solution to add a management command that updates the expanded value of STATIC_URL in your existing text plugins? This command would have to be manually invoked when STATIC_URL changes.

@ojii
Collaborator
ojii commented Dec 30, 2011

by the way are you sure that you're talking about STATIC_ROOT and not STATIC_URL?

@m000
m000 commented Dec 30, 2011

You are right. I meant STATIC_URL. I have updated the thread accordingly.

@ojii
Collaborator
ojii commented Dec 30, 2011

Thank you, makes a lot more sense now and I understand how this is a real issue. Milestone changed to 2.3

@FrankBie2

So an update from MEDIA_URL to STATIC_URL is currently not possible? Meaning 2.2.post version to 2.3 develop?

@ojii
Collaborator
ojii commented Jun 26, 2012

I don't think that changing STATIC_URL happens often enough to make this a priority. So unless someone can come up with an easy and usable solution, I'll put this on hold for now.

@digi604
Member
digi604 commented Feb 10, 2014

text plugin is not in core anymore

@digi604 digi604 closed this Feb 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment