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

Intermittent HtmlField Saving #358

Closed
benyoungnz opened this issue Aug 8, 2018 · 4 comments
Closed

Intermittent HtmlField Saving #358

benyoungnz opened this issue Aug 8, 2018 · 4 comments

Comments

@benyoungnz
Copy link

Has anyone else had an html field, sometimes save and sometimes not?

I am running 5.1.1 currently, confirmed this on a couple of different models, cant get it to consistent;y work/not work

  • If i copy and paste into the editor (from another piranhacms editor) and even make changes to the text it almost never works
  • If i write in there new, change some bold text/heading/paragraph anything it sometimes saves
  • Injecting text into the field via the API works fine and is committed to the DB every time

Have tried a different client browser (chrome and IE) to rule out any editor weirdness, fails/consistent behavior on both

Console does not show any JS errors, no obvious errors on the stdout log files

Thoughts?

Field is defined like the one below

        [Field(Title = "Biography")]
        public HtmlField Bio { get; set; }
@benyoungnz
Copy link
Author

Figured out the "intermittent" bit looking at the request to the server on save.

Lets say for example the bio field is "test test test"

load page and makes changes in editor to "test test test1"

Request looks like the following (when save is clicked after the edit made)

  • Notice that value is still test test test
Regions[0].FieldSet[9].Id: Bio
Regions[0].FieldSet[9].CLRType: Piranha.Extend.Fields.HtmlField
Regions[0].FieldSet[9].Value.Value: <p>test test test</p>

Now, without navigating anywhere, click save again and... it actually saves.

Regions[0].FieldSet[9].Id: Bio
Regions[0].FieldSet[9].CLRType: Piranha.Extend.Fields.HtmlField
Regions[0].FieldSet[9].Value.Value: <p>test test test1</p>

@tidyui
Copy link
Member

tidyui commented Aug 8, 2018

Ok, I'm guessing the error was introduced in 5.1 when the page save was moved over from form submit to ajax post. Given your description it sound like TinyMce doesn't update the backing textarea before the data is submitted to the server.

@benyoungnz
Copy link
Author

Loving your work as always! rolled that into my version here - works great

@tidyui tidyui self-assigned this Aug 10, 2018
@tidyui
Copy link
Member

tidyui commented Aug 10, 2018

This has now been released and is available in Piranha.Manager 5.1.2

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

No branches or pull requests

3 participants