-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit text -> save -> images doublicated #421
Comments
Could you check the source before saving? (preferably click source, go back, click source again)
instead of
What happens on save is you have one image that is a cms plugin, and another is just an image in the markup (because whatever is in between cms-plugin tags gets always replaced by the contents of that plugin). I would recommend upgrading to a more recent version of djangocms-text-ckeditor, as I remember fixing those bugs |
I'm not entirely sure what you mean by
But here is what I've done: 1. Edit mode, but not edited yet 2. Edit mode, after saving We're using a custom template here for the cmsplugin-filer-image plugin. But it doesn't look like the I have indeed updated djangocms-ckeditor to 3.4.0 in the meantime. |
Oh, I meant "Source" button in ckeditor, "Quellcode" on your screenshots Is the problem still there after updating? Custom templates are fine. |
That's exactly what I meant, thanks. Could you please show your ckeditor settings from settings.py (and if they reference any external js configuration files i'd like to check them out too) and also check if |
settings
template
|
If you're saying 'it looks like the problem I was describing', do you mean that you've come across this before? My client is getting a little impatient on this problem, as they can't really edit any text content with images in it... Do you think this is solvable without too much manual work? |
Yes, it's something that I think should've been fixed in #353 As to how solvable it is - don't know for sure. I'm going to try to reproduce on a clean project, but can't promise it'll be fast |
You mean adding these two lines to
|
Yes. The css one is more important (and it has to match your project's css path). |
Could you try putting this file under that path https://github.com/divio/django-cms-explorer/blob/master/static/js/addons/ckeditor.wysiwyg.js ? |
Sadly i can't reproduce an issue on a blank project with
as plugin markup. I'll investigate more |
Is there anything else I can assist with? Would it be helpful to see another set of screenshots of |
i don't think cms 3.2.1/ckeditor 2.8.1 would be helpful, too much changed since then. it would be helpful if you could try reproducing that on a reduced environment we can debug afterwards, e.g. sample project on github, but otherwise i don't know @czpython maybe you could think of something? |
Kind sir. I have set up an example project: https://github.com/creimers/ckeditor_bug Unfortunately, I haven't been able to reproduce the faulty behavior so far. Leaves me a bit puzzled. I will try to reproduce this with the original project and a clean database. For a better understanding: Where do you think this bug most likely resides? Is it a django thing or a javascript thing? |
I have another interesting detail to share (I hope). I rolled back to the When editing that image embedded in text, all I get to see is a placeholder: Source: Upon right clicking that placeholder, I get the CMSPlugin menu, however. This is also strange, isn't it? |
The bug most likely resides in JavaScript and in the way the markup is handled by browsers. I.e. the browser encounters some markup that isn't valid - and tries to unwrap it to the best of it's ability, e.g The 2.8.1 behaviour is correct, we didn't have "inline preview" before 3.x and plugins were rendered as images. (which was a problem in itself because plugins can have arbitrary markup inside that is not compatible with how image is viewed by browsers - and so real output of text plugin would be different from what is inside it's "Source" view) |
I'm considering to downgrade the whole system again to |
I did indeed downgrade the system to What it also does: it gives me these empty tags in the text where there used to be the duplicated image... can that be a trace? While downgrading works for now, it can't be a solution. I really want to keep my project dependencies up to date, as you will understand. I was thinking: would it be helpful if I were to provide to you a stripped down dump of my database in the original |
Well 2.8.1 doesn't have any special handling for Anything that would help us reproduce the issue would be good, since so far we couldn't |
@vxsx Can your provide me with your bitbucket username? I prepared a repo in which this behaviour is reproducible. |
@creimers same as on github, vxsx |
Experiencing the same problem, clean install, no overrides of the text editor JS/CSS Is there any mitigation that could be used for this? |
I am running on Divio, so if you guys are using the platform as well, I should be able to give you access to the stage server. Also, our editor has reported that this is happening only when more than one image is present on a page. |
@petrklus it might also be invalid markup of the plugin that's inlined (unclosed tag etc) |
@vxsx Thank you very much! Just sent you a message via Intercom with staging URL where the problem can be reproduced |
@vxsx Just updated to 3.5 and still seeing the same issue (re-build the test page to be on a safe side). On every save, each image gets duplicated |
@creimers does 3.5 solve your issue? It does not seem to help me |
Correction - 3.5 does seem to be fixing it (Just make sure you delete all old templates/static files Divio project init brings in to make sure it's really running all 3.5 html/css). Thanks to @vxsx for assistance today. |
@petrklus Yes, upgrading to 3.5 solved the issue for me. Also, I had invalid markup in my image plugin template. |
Hi peoples, i'm upgraded to 3.5 version, but dosen't resolved this problem. |
@flaviocampiteli did you purge the static folder contents that had the old scripts in? |
This is still a problem for me.
Now open
Now we build the docker container and start everything.
Please confirm the reproduction and reopen the issue. |
@creimers could you please reopen this issue? |
@mogoh With great joy. |
Hello @mogoh In case you have the same issue, you can also create a new one ;) |
@creimers Thank you. @crydotsnake I did not want to “clutter” the tracker with to many issues. If it is the same problem, then, I thought it would be best to not create a new issue. But different projects have different policies. Anyway if would be great, if someone can confirm my reproduction steps. |
Sorry, I can only guess: Have you tried to set AFAIK djangocms-text-ckeditor has a different by-default-setting and djangocms-bootstrap4 only works with drag and drop disabled. |
@fsbraun sorry, I used the wrong phrase. I meant “out comment”, not “uncomment” the djangocms bootstrap4. Djangocms bootstrap4 is in the part of the django-cms-quickstart repository, but for reproduction of this issue, I needed to remove it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This will now be closed due to inactivity, but feel free to reopen it. |
After updating the cms (3.2.X --> 3.3.3) and the ckeditor (2.8.1 --> 3.1.0), I'm observing a very strange behavior.
Here's a visual example.
Before editing:
![bildschirmfoto 2017-03-30 um 14 16 48](https://cloud.githubusercontent.com/assets/6090492/24503752/b6d2cfc8-1553-11e7-8d96-8a176108add9.png)
After editing:
![bildschirmfoto 2017-03-30 um 14 17 37](https://cloud.githubusercontent.com/assets/6090492/24503760/bec7058c-1553-11e7-9d20-b8f874f7479b.png)
In structure mode, however, it says that there is only on image instance:
Here's the one that does:
![bildschirmfoto 2017-03-30 um 14 22 21](https://cloud.githubusercontent.com/assets/6090492/24503942/81a5b904-1554-11e7-85fe-f5f4c61e2bbf.png)
And here's the one that doesn't:
![bildschirmfoto 2017-03-30 um 14 22 37](https://cloud.githubusercontent.com/assets/6090492/24503960/95a864ce-1554-11e7-8a21-bf8d3bb305f3.png)
When I add a fresh instance of a text plugin to the placeholder (on the same page), the described behavior can not be observed. I applies only to text with nested images that existed prior to the updates.
Likewise, when I delete all images from an existing plugin instance, save, then go and add them again, the plugin and images behave as expected again.
Have you come across this yet? Do you have any suggestions on how to tackle this?
The text was updated successfully, but these errors were encountered: