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

Document requirement of certain editor _init.js files #235

Open
manu37 opened this issue Sep 25, 2021 · 2 comments
Open

Document requirement of certain editor _init.js files #235

manu37 opened this issue Sep 25, 2021 · 2 comments
Milestone

Comments

@manu37
Copy link
Collaborator

manu37 commented Sep 25, 2021

Shop's product editing fails if in editor no init_minimal.js(on) and init_medium.js(on) file exist.
Please add system check accordingly.
Or is this rather an editor problem/missing fallback?

@manu37 manu37 added the bug label Sep 25, 2021
@cmb69
Copy link
Member

cmb69 commented Sep 28, 2021

Ugh, that is indeed hard-coded:

$bjs .= '<script>'
. editor_replace('xhsTeaser', 'minimal')
. editor_replace('xhsDescription', 'medium')
. '</script>';
}

Not sure if a system check is the best solution; maybe config options? And of course, documentation.

@frase-git frase-git added this to the 1.1 milestone Jan 12, 2023
@cmb69
Copy link
Member

cmb69 commented Jan 12, 2023

Or is this rather an editor problem/missing fallback?

That is at least partially related to cmsimple-xh/cmsimple-xh#546. Without a respective fix, TinyMCE 5 will not work, regardless of the chosen init. With the fix, at least existing inits will properly initialize the editor.

Please add system check accordingly.

That would require the shop to look up the existing init files of the configured editor, what would require the shop to know about the details (where they are stored, and the exact filenames). I don't think this should be the job of extensions using the editors.

Okay, there would be a loophole, namely that such extensions could call editor_replace(), and checking its result; after the TinyMCE 5 issue mentioned above, the result would be an empty string, indicating that a missing init is referred to. Unfortunately, the would be different with TinyMCE 4, since that would return the given init string unmodified. Not sure how other editors would behave (there is at least Codeeditor_XH, which I would need to check, but there may be others).

So this looks too fiddly. A clean solution would be to add a new function for editor to implement, which allows to check whether certain inits are supported. Basically, something like tinymce_getInits(), but that would need to be standardized.

Not sure if a system check is the best solution; maybe config options?

Config options would have the same problem as mentioned above, so that doesn't look like a reasonable solution for now.

And of course, documentation.

I think this is the only remaining option for the time being.

@cmb69 cmb69 added documentation and removed bug labels Jan 12, 2023
@cmb69 cmb69 changed the title Check appearance of editor _init.js files Document requirement of certain editor _init.js files Jan 12, 2023
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