Skip to content
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

Old content getting saved? #52

Open
jonom opened this issue Dec 15, 2016 · 9 comments
Open

Old content getting saved? #52

jonom opened this issue Dec 15, 2016 · 9 comments

Comments

@jonom
Copy link
Contributor

jonom commented Dec 15, 2016

I have a weird issue going on, might have nothing to do with this module, but it seems to only affect HTMLEditorFields and began when I shipped an update that installed this module, so may be a correlation.

Basically, every now and then when you save a page in the CMS, the Content is replaced with Content from a previously viewed page. I can't work out steps to reproduce it reliably, it just seems to happen randomly. Doesn't seem to make a difference whether you have edited the Content or not, instead of saving what is visible in the Content HTMLEditorField when you hit save, some other page's Content gets saved and loaded back in after the pane refreshes.

Raising the issue here just in case you know of how this could come about? Maybe some variable or cache that's persisting some how?

I wondered if it is related to #45 somehow?

@sheadawson
Copy link
Owner

Ha. I had a client tell me that happened to them and I thought they were crazy. No idea how it would be happening but would be good to get it figured out

@camexapps
Copy link

camexapps commented Jan 17, 2017

Yep, same here... the workaround for them was to introduce the 'fix' of (#45) :

ed.save();

Which is see was removed in the b8b6986 commit, but apparently was causing/introducing some issues?

Personally, I have had no issues with the 'fix' addition. As I understand it was converting/parsing the Shortcodes wrong?

@jonom
Copy link
Contributor Author

jonom commented Jan 17, 2017

#45 might have fixed some small issues but it introduced a big breaking one (#49). Maybe ed.save() is needed but but timing of shortcode conversion needs to change to ensure it happens afterward? Not sure. I tried to look in to it but got lost.

@jjjjjjjjjjjjjjjjjjjj
Copy link
Contributor

This is happening to one of our clients as well, seemingly at random. Sometimes the content gets replaced with another page's content, and sometimes all the content is removed. Do we have any new leads on this? Where would be a good place to start debugging this?

MrJamesEllis pushed a commit to MrJamesEllis/silverstripe-shortcodable that referenced this issue Feb 23, 2017
…ontent using setContent, call _super for saving of HTMLEditorField content
@jules0x
Copy link

jules0x commented Mar 1, 2017

The fix @MrJamesEllis pushed does not fix #52 or #49 for me.
Once the content from another page has overwritten the content on the current page, I can even toggle between previous and 'current' content by repeatedly clicking the Save button without making any changes.

@mediabeastnz
Copy link

I'm having this issue as well. I can't seem to figure out why it's random and not on every submit.

@tomstgeorge
Copy link

I have a client reporting this issue as well... this is a pretty serious bug. Any ideas on where to look to try to fix it?

@sheadawson
Copy link
Owner

@tomstgeorge I think the best clues are in this thread, sorry I don't have time to help with this at the moment

@faloude
Copy link

faloude commented Aug 17, 2017

I think I've sorted the issue. I was using a HTMLEditorField::create('content'). Notice that the the field name is set in the constructor but the field label isn't.

It was a longshot to think this would be causing the issue, but I simply added the label field and the bug seems to be vanished.

Edit: Unfortunately I was wrong. Content is still being deleted / overwritten, disastrous bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants