News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Empty editor when modifiying posts with quotes

Started by voom, May 24, 2022, 07:41:38 AM

Previous topic - Next topic

voom

Since a few days when modifying posts that have quotes in them, the editor is empty. Quick edit works. I have in those days installed two mods and one theme. Uninstalling the mods changes nothing (they are of the type "hooks only" anyway). Could an extra theme (Fusion) lead to the editor reacting this way even when the default theme is selected? What else could cause this?

voom

Some posts with quotes work, but most don't. Also, I found, that with those posts the editor does not show the row with the smileys.

The theme was probably not the source of the problem, which persisted when I deactivated the fusion theme.

Doug Heffernan

Quote from: voom on May 24, 2022, 07:41:38 AMSince a few days when modifying posts that have quotes in them, the editor is empty. Quick edit works. I have in those days installed two mods and one theme. Uninstalling the mods changes nothing (they are of the type "hooks only" anyway). Could an extra theme (Fusion) lead to the editor reacting this way even when the default theme is selected? What else could cause this?

Since the error happened when you installed third party mods/themes, it stands to reason that one of them might have caused it. You uninstalled the mods, can you do the same with the custom theme as well and see if the error will go away?

Is there any error logged in the error log?

Kindred

when you say "have quotes in them" -- do you mean have the quotation marks in them or have a
[quote]...[/quote]
 in them
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

voom

Quote from: Kindred on May 24, 2022, 07:57:10 AMwhen you say "have quotes in them" -- do you mean have the quotation marks in them or have a
[quote]...[/quote] in them
The latter....

I did uninstall the mods (OP) and at least deactivated the theme.... I'll check for the logs...

voom

BTW the content can be seen for a splitsecond before the editor goes empty. The error log does not show anything of relevance in my eyes. There are a few notices about smileys, but only notices. Then there is a pattern match for mod security referring to a single PM, so that can't be it either. Also, when triggering the issue, there is no new entry in the log.

Kindred

so yeah....   if there is a failure in the BBC like that, it is pretty much guaranteed to be due to a bad mod or theme...

Suggest re-loading a CLEAN set of 2.1.2 files. Remove all hooks. Reset to the Default theme. Confirm it works

THEN try installing mods one at a time.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

voom

I had not installed any mod for a longer time, where it worked, and the mods and the theme installed after that I did uninstall.

I am still in the kind of heuristic thinking: what could cause the smiley-toolbar (outside of the editor-iframe in the regular dom) to disappear and the content of the editor (within the editor-iframe) to be not visible, but technically there. Because: when I save the post from the editor where nothing is visible, the post is still there.

This looks like two separate issues, but they only occur together.

voom

This is interesting - in the browser console:
jquery-3.6.0.min.js:2 Uncaught ReferenceError: bbc_quote is not defined
    at R.html (minified_454394b2c1a0e4cf3fadac5d47b28e1a.js?smf212_1653397385:698:120)
    at e (jquery.sceditor.bbcode.min.js?smf212_1653397385:3:81904)
    at R.m.toHTML (jquery.sceditor.bbcode.min.js?smf212_1653397385:3:82226)
    at t (jquery.sceditor.bbcode.min.js?smf212_1653397385:3:85326)
    at on.se.val (jquery.sceditor.bbcode.min.js?smf212_1653397385:3:57608)
    at A (jquery.sceditor.bbcode.min.js?smf212_1653397385:3:48214)
    at e (jquery.sceditor.bbcode.min.js?smf212_1653397385:3:47185)
    at new on (jquery.sceditor.bbcode.min.js?smf212_1653397385:3:67884)
    at create (jquery.sceditor.bbcode.min.js?smf212_1653397385:3:69205)
    at Object.sceditor.create (minified_454394b2c1a0e4cf3fadac5d47b28e1a.js?smf212_1653397385:630:142)

Since it seems to be the BBC quote that triggers the error

Kindred

yes. exactly...

and since this issue is NOT repeatable in a clean installation, you MUST have something competing/breaking the system.

The proper way to debug this, since you don't know WHAT started it, is to put in a clean set of files, removing all mods and themes... and then check as you install each one.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Steve

Quote from: voom on May 24, 2022, 07:41:38 AMUninstalling the mods changes nothing (they are of the type "hooks only" anyway).
Just because they are 'hooks only' mods doesn't mean they won't cause problems if you uninstall them. Trust me, I know because it just happened to me and I had to enlist the aid of @Doug Heffernan (another Support Team member) to find the problem, which was duplicated hooks in the database.

So follow Kindred's advice.
DO NOT pm me for support!

voom

In case someone likes playing detective, like me, I commented out the following lines starting at 880 in jquery.sceditor.smf.js 

/*,
html: function (element, attrs, content)
{
var attr_author = '', author = '';
var attr_date = '', sDate = '';
var attr_link = '', link = '';

if (attrs.author || attrs.defaultattr)
{
attr_author = attrs.author || attrs.defaultattr;
author = bbc_quote_from + ': ' + attr_author;
}

if (attrs.link)
{
attr_link = attrs.link;
link = attr_link.substr(0, 7) == 'http://' ? attr_link : smf_prepareScriptUrl(smf_scripturl) + attr_link;
author = '<a href="' + link + '">' + (author || bbc_quote_from + ': ' + link) + '</a>';
}

if (attrs.date)
{
attr_date = attrs.date;
sDate = '<date timestamp="' + attr_date + '">' + new Date(attr_date * 1000).toLocaleString() + '</date>';

if (author !== '')
author += ' ' + bbc_search_on;
}

return '<blockquote data-author="' + attr_author + '" data-date="' + attr_date + '" data-link="' + attr_link + '"><cite>' + (author || bbc_quote) + ' ' + sDate + '</cite>' + content + '</blockquote>';
} */

Now the editor keeps the content, and the quote appears as a blockquote but without the author and date info. They will get inserted into the actual view of the post. So this is a little "dirty fix" that works for me for now until I have time for more. To either figure out why the HTML inserted into the WYSIWYG view of the editor breaks it, or go through the tedious steps suggested in the thread, if necessary.

Kindred

Just so you know, this is *NOT* the way to FIX the issue.   You have instead removed the code that works on every other system and potentially introduced a whole 'nother set of problems
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

voom

Quote from: Kindred on May 24, 2022, 01:47:16 PMJust so you know, this is *NOT* the way to FIX the issue.   You have instead removed the code that works on every other system and potentially introduced a whole 'nother set of problems
I know, as I said, this is a "dirty fix" so I can attend to the issue when I have time. Rebuilding everything from scratch and checking every step is a quite tedious way to find the source of an issue.

Arantor


voom

english,  german and german_informal - mostly german_informal

voom

Basically, when the code I commented out is executed, bbc_quote and bbc_quote_from are "not defined" according to the error messages in the console.

voom

I was successful with my investigation and found the culprit-mod (luckily without having to start from scratch). In my case, this https://custom.simplemachines.org/index.php?mod=4087 was getting in the way. Also, luckily this mod was not really necessary, I tried to fix another problem with it, which it didn't fix. It's not really doing anything for me - well except saving space on the server by converting and compressing image-attachments.


GL700Wing

Quote from: voom on May 24, 2022, 08:17:28 PMI was successful with my investigation and found the culprit-mod (luckily without having to start from scratch). In my case, this https://custom.simplemachines.org/index.php?mod=4087 was getting in the way. Also, luckily this mod was not really necessary, I tried to fix another problem with it, which it didn't fix. It's not really doing anything for me - well except saving space on the server by converting and compressing image-attachments.
I started investigating the cause of this issue just after it was reported earlier today but as yet I have no idea why this mod is causing the following JavaScript issues/error messages with the 'Modify' action:
Uncaught SyntaxError: expected expression, got ',' and bbc_quote_from is not defined
Life doesn't have to be perfect to be wonderful ...

Advertisement: