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

Parsing-Error with custom layout with IRichText #404

Open
agschaid opened this issue Feb 20, 2018 · 7 comments
Open

Parsing-Error with custom layout with IRichText #404

agschaid opened this issue Feb 20, 2018 · 7 comments

Comments

@agschaid
Copy link

Hi,

in one of our custom layouts we use a behavior that is a sub-class to IRichtText:

from plone.app.contenttypes.behaviors.richtext import IRichText
 
@provider(IFormFieldProvider)
class IRichTextWithTeaser(IRichText):

    # there is a subscriber filling the richtext_teaser_text according to some business logic
    directives.mode(richtext_teaser_text='hidden')
    richtext_teaser_text = schema.Text(
        title=u'Hidden Field',
        required=False,
    )

(we access the text field of IRichText)

When the tile that is accessing the text field is included in the current layout (regardless of whether the field is in the layout definition or was added by drag and drop) we often see a error in our javascript console: TypeError: e.parser is undefined

When this error occurs we can't save the page and the autosave feature of text-boxes also doesn't work.
Usually (but not always) this error can be prevented by doing "Layout->Customize" before doing any (!) editing.

we haven't been able to find anything about this error. Is this a know issue? Any help?

@agschaid
Copy link
Author

P.S.: sometimes refreshing the page (multiple times) fixes the problem. Changing the view and changing it back does the trick.

All in all it's a pretty erratic and spontaneous behavior ;)

@slo-ge
Copy link

slo-ge commented Mar 9, 2018

Hola.

I have the same problem using plone.app.textfield import RichText in our schema.

text = RichText(
        title=u"Footer Text",
        default_mime_type='text/html',
        output_mime_type='text/x-html-safe',
        allowed_mime_types=('text/html',),
        default=u"",
        required=False
    )

Following JS error appears in my console:

Uncaught TypeError: Cannot read property 'parse' of undefined
    at H.setContent (plone-logged-in-compiled.js:40000)
    at p.saveForm (plone-mosaic.js:198)
    at p._change (plone-mosaic.js:198)
    at p._focus (plone-mosaic.js:198)
    at p.focus (plone-mosaic.js:198)
    at p.select (plone-mosaic.js:198)
    at H.<anonymous> (plone-mosaic.js:198)
    at b.e [as fire] (plone-logged-in-compiled.js:25934)
    at H.fire (plone-logged-in-compiled.js:26254)
    at H.<anonymous> (plone-logged-in-compiled.js:40763)
setContent @ plone-logged-in-compiled.js:40000
p.saveForm @ plone-mosaic.js:198
p._change @ plone-mosaic.js:198
p._focus @ plone-mosaic.js:198
p.focus @ plone-mosaic.js:198
p.select @ plone-mosaic.js:198
(anonymous) @ plone-mosaic.js:198
e @ plone-logged-in-compiled.js:25934
fire @ plone-logged-in-compiled.js:26254
(anonymous) @ plone-logged-in-compiled.js:40763
e @ plone-logged-in-compiled.js:25934
fire @ plone-logged-in-compiled.js:26254
e @ plone-logged-in-compiled.js:34825
a @ plone-logged-in-compiled.js:1181
v @ plone-logged-in-compiled.js:1287

Thanks for help.

@agschaid
Copy link
Author

Bump?

@pfraterdeus
Copy link

same problems here...
I've pinned the mosaic components per
https://github.com/plone/plone.app.mosaic/blob/master/versions.cfg

I am getting very sad about not being able to edit my plone site at all for months now.
Not a developer, just a lowly admin, I am running a plone 5.1.most-recent buildout, and have tried just about everything to be able to edit the pages again.

I guess I just need to know if Mosaic is really ready for prime-time.
With the experience I'm having, I'd never in a million years recommend it to a client or end-user.
What is it about Plone which seems so fragile? It's robust in so many ways, but I have never had a Plone 5 site that actually worked as desired.
Constant struggles and frustrations.
Should I just forget about Plone, since I will never have the time or expertise to patch the fibers and upgrade the trilithium crystals?

I am a competent *nix admin, no problem following directions, but this ecosystem may just be beyond my capacities. :(

:-(

@petschki
Copy link
Member

petschki commented Jul 4, 2018

@pfraterdeus @agschaid just tried to reproduce your problems with latest versions (fresh Plone 5.1- and https://github.com/plone/plone.app.mosaic/blob/master/versions.cfg) ... everything works as expected. I added a custom behavior (normal text and richtext) to the document and edited the page without any errors. I also created a custom layout and used in on another page, edited data ... all good.

googling for the javascript errors above leads to some TinyMCE initialization errors ... maybe you can enable development mode for layouts-editor and mosaic resource bundles and give some more insights into the error?

@petschki
Copy link
Member

petschki commented Jul 4, 2018

NOTE: this is maybe related: #407

@pfraterdeus
Copy link

@petschki
Thanks much. I'm going to be away from the console for a few weeks traveling but I very much appreciate the insights and advice.
When I'm back to this, I'll certainly see what else I can discover.
Would love to see this issue addressed with a fix which will make existing mosaic layouts behave correctly.
it seems as if it broke with an update somewhere along the line, as I was happily editing pages for some time, and then not... Wish I'd been documenting the sequence of changes leading up to the frustration but honestly I usually assume I've just done something stupid, hack at it for a while and give up. Not a great UX.

krissik pushed a commit that referenced this issue Mar 11, 2024
Preserve order of behaviors during installation
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

4 participants