SMF QuickModify/Edit Console Error

Started by kapt, September 13, 2021, 02:31:20 AM

Previous topic - Next topic

kapt

As soon as I say "Quick Edit" a message, I get this error in the console after I edit the message. I am facing this issue only in "Quick Edit" option.







Details




Arantor

Looks to me like the custom theme you have has some bugs, where divs have been removed from Display.template.php and the JavaScript doesn't know about it.

kapt

Quote from: Arantor on September 13, 2021, 03:46:20 AMLooks to me like the custom theme you have has some bugs, where divs have been removed from Display.template.php and the JavaScript doesn't know about it.

Is the problem in the Display.template.php file?

I replaced the Display.template.php file in my custom theme with the Display.template.php file in the default theme. The problem is still the same.

kapt

#3
I think they posted the solution here. But I didn't understand.

https://www.simplemachines.org/community/index.php?topic=556897.0


Arantor

So you have a modification that has broken quick editing by moving the top_subject element in the template. Does it work in the default theme?

kapt

Quote from: Arantor on September 13, 2021, 06:57:52 AMSo you have a modification that has broken quick editing by moving the top_subject element in the template. Does it work in the default theme?

The default theme and my custom theme has the same issue.

I found another solution topic, but I don't have the necessary information, maybe it will be useful for you.
https://www.simplemachines.org/community/index.php?topic=527883.msg3744630#msg3744630

Arantor


kapt

1.   Add Social Media Icons To Profiles   1.2.0    
2.   Board Icons   1.0    
3.   Box BBCode   1.2    
4.   Child Board Removal   1.0    
5.   Smf divboxkenarsiz   1.0    
6.   Image Floating to Left or Right BBCode   1.22    
7.   PM Informer   4.0.1    
8.   PM to New Members   1.2    
9.   'Read the Rules' Link Above Post Button   2.0    
10.   @mention members   1.1.2    
11.   Smf Divbox   1.0    
12.   SMF Post Prefix   2.1.1    
13.   SMF Versatile Post Reactions   1.3    
14.   Word Description   1.0    
15.   Yet Another Spoiler Mod   1.2    

kapt


shadav

please allow at least 24 hours before bumping a topic thank you

and off the top of my head of the list of mods all I can think of is the 'Read the Rules' Link Above Post Button
use the parse button on the mod's download page and make sure that the edits were all done correctly

kapt

Quote from: shadav on September 13, 2021, 11:45:49 AMplease allow at least 24 hours before bumping a topic thank you

and off the top of my head of the list of mods all I can think of is the 'Read the Rules' Link Above Post Button
use the parse button on the mod's download page and make sure that the edits were all done correctly

I removed it but the problem still persists. Do you know which file is causing the problem?

Arantor

I was going to look at it when I was done with work, I don't have access to a machine to debug this until I'm done with work.

Steve

@ kapt:

Arantor's post illustrates one of the reasons for waiting 24 hours before bumping a post. We're all volunteers and not able to answer all questions as soon as they're posted. Thanks for your understanding.
DO NOT pm me for support!

shadav

and to add on to what steve said, no sorry I don't know which file or mod, I just guessed the  rules one because I know it edits that area...but of all people who would know better would be arantor and so most others probably won't reply if they see he's already helping you

Arantor

This would be an awful lot easier if it weren't your localhost, because I could then take a look at what the site is actually doing instead of guessing.

However, none of the mods are in common with the other case identified earlier in the thread, so that's not a place to start.

The thing to do, is to go to a topic where you're trying to edit, view the source (not use the inspector) and look for an element in the page with the id 'top_subject' and specifically what this contains if it is present. If you could find that in the view-source specifically, and post the result here, that will help.

kapt

Quote from: Arantor on September 13, 2021, 05:51:59 PMThis would be an awful lot easier if it weren't your localhost, because I could then take a look at what the site is actually doing instead of guessing.

However, none of the mods are in common with the other case identified earlier in the thread, so that's not a place to start.

The thing to do, is to go to a topic where you're trying to edit, view the source (not use the inspector) and look for an element in the page with the id 'top_subject' and specifically what this contains if it is present. If you could find that in the view-source specifically, and post the result here, that will help.

My forum: https://aurydeneme.000webhostapp.com/forum/

user id: quicktestuser
pass: 123test123

test topic: https://aurydeneme.000webhostapp.com/forum/index.php?topic=188.0

I found an important detail. Only when I "Quick Edit" the topic I opened, the console gives an error. When I "Quick Edit" my messages, it does not give an error.


Arantor

That last detail was already one I knew, I'll take a look when I'm done with work for the day...

Arantor

OK, so this is actually a bug in 2.0. The relevant element is missing a span - yet, it's there in the Core theme, it's there in 2.1, but apparently not in 2.0 Curve. Since it's only for quick edits to the first message in a topic and replacing the title of the topic in the header once you have quick edited, it's not tragic if it doesn't work properly.

Themes/default/Display.template.php needs a change - probably so too your custom theme

Code (find) Select
echo '
<div id="forumposts">
<div class="cat_bar">
<h3 class="catbg">
<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
<span id="author">', $txt['author'], '</span>
', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')
</h3>
</div>';

Code (replace) Select
echo '
<div id="forumposts">
<div class="cat_bar">
<h3 class="catbg">
<img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
<span id="author">', $txt['author'], '</span>
<span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span>
</h3>
</div>';

Oh, and also you should upgrade to 2.0.18 since you're not on it, and put the SMF copyright back. The only reason I'm still posting this far is because I'd already done the detective work before I realised no SMF copyright in the footer.

Diego Andrés


SMF Tricks - Free & Premium Responsive Themes for SMF.

Steve

Locking. No further assistance will be provided until the copyright is permanently put back.
DO NOT pm me for support!

Advertisement: