Quick Edit not editing?

Started by samborabora, July 24, 2014, 03:08:16 PM

Previous topic - Next topic

samborabora

Just realized that after many months, and not using it, my Quick Edit/Inline Modify button isn't working. The strange part is, unlike other users who have posted similar problems, it DOES pop up at the top and it does load the text box and I can click save. It just doesn't actually reflect any changes I make in the post. I've checked my error logs and can't see anything pertaining to this lack of function. What could be the probable cause of it seemingly functioning, but failing to actually commit the edit?

Justyne

What version of SMF do you use and could mods be affecting this behaviour or possibly themes? Does this work on the default theme?
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

samborabora

It works on the default theme, so it must be my theme that's caused the problem. I have quite a number of mods installed, but I haven't got any errors coming up in the logs, it wouldn't work in the default if it was a mod? Do you want me to post my mods? Gulp...

1. Buddies Block 1.0 [ Uninstall ]
2. Followers 1.2 [ Uninstall ]
3. Improved Displayed Times Mod 1.0 [ Uninstall ]
4. Ignore User Button 1.0 [ Uninstall ]
5. Soundcloud BBcode 1.6 [ Uninstall ]
6. Unread PMs Favicon 1.0 [ Uninstall ]
7. Inline Hover Spoiler 1.5 [ Uninstall ]
8. Tapatalk SMF 2.0 Plugin 3.9.5 [ Uninstall ]
9. Mobile Device Detect 0.2.2 [ Uninstall ]
10. SMF 1.1.19 / 2.0.6 Update 1.0 [ Uninstall ]
11. TopicStarter Mod 1.7 [ Uninstall ]
12. SMF4iPhone-Mod 1.1 [ Uninstall ]
13. Menu Button Manager Beta 4.2 [ Uninstall ]
14. SimplePortal 2.3.5 [ Uninstall ]
15. Tidy Child Boards 1.4.1 [ Uninstall ]
16. Board Icons 1.0 [ Uninstall ]
17. Child Board Hover 1.0 [ Uninstall ]
18. PM to New Members 1.2 [ Uninstall ]
19. Optimus Brave 1.8.6.2 [ Uninstall ]
20. Default Avatar 2.3 [ Uninstall ]
21. Pretty URLs 1.0 [ Uninstall ]
22. Simple Youtube Video Embedder/BBC 1.1 [ Uninstall ]
23. Remove Help From Menu 1.0 [ Uninstall ]
24. Quick Moderation on Quick Reply 1.1.2 [ Uninstall ]
25. Share this topic - SMF Mod 1.3 [ Uninstall ]
26. SA Facebook 2.0.2 [ Uninstall ]
27. Registered Links 3.0 [ Uninstall ]
28. Delete Spam Posts 1.6 [ Uninstall ]
29. Install & Uninstall Mods Quickly 1.4 [ Uninstall ]
30. SMF Gallery Lite 3.6a [ Uninstall ]

Justyne

sounds like it is a theme issue then.

If you have a tool like ExamDiff it might be easiest to just compare your theme to the default theme and check what you changed to break it.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Hj Ahmad Rasyid Hj Ismail

You can use Notepad++ too to compare files as well.

But try to look at mod that have effect on display page files (Display.php / Display.template.php) like #24.

It is also possible that it may caused by the code that changes inline modify button to text that I have shared with you in another post.

Hj Ahmad Rasyid Hj Ismail

With regards to your problem, try to use this code instead and see if it is working:

<a alt="', $txt['modify_msg'], '" title="' . $txt['modify'] . '" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" >i', $txt['modify'], '</a>

Note: Earlier shared code may not be properly working as I missed the  id="modify_button_', $message['id'], '".

samborabora

Quote from: ahrasis on July 24, 2014, 07:26:25 PM
With regards to your problem, try to use this code instead and see if it is working:

<a alt="', $txt['modify_msg'], '" title="' . $txt['modify'] . '" id="modify_button_', $message['id'], '" onclick="oQuickModify.modifyMsg(\'', $message['id'], '\')" >i', $txt['modify'], '</a>

Note: Earlier shared code may not be properly working as I missed the  id="modify_button_', $message['id'], '".

Thanks, I've changed it, but it's still broken so I'll have to check the mods to see if that's what's causing the problem. To be honest, many of those I installed when I first put SMF on and I've never even tried the inline modify, so it's quite a suprise that it didn't work. I think I'll have to progressively go through each one and see what's causing it. I just can't figure why it would appear that it was working all the way, but just doesn't change it after pressing save. You'd think it would have some problem before that point if it was a javascript issue?

Hj Ahmad Rasyid Hj Ismail

Quote from: samborabora on July 25, 2014, 05:59:06 PM
I think I'll have to progressively go through each one and see what's causing it.

That's the best...

samborabora

I still haven't fixed this, what code does the quick edit reply on that could be missing from my theme, I assume it will all be in Display.template?

margarett

It might be a JS conflict, something wrong with the theme or something blocking the AJAX call (mod_security?)

I would suggest you to backup your theme and load a fresh copy of it (even if you will temporarily loose some MODs) just to debug. Then you can restore your backup.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on July 21, 2015, 09:34:07 AM
It might be a JS conflict, something wrong with the theme or something blocking the AJAX call (mod_security?)

I would suggest you to backup your theme and load a fresh copy of it (even if you will temporarily loose some MODs) just to debug. Then you can restore your backup.

Yeah, I'm sure it is some kinda conflict, I'm just useless with javascript and have no idea what it could be! After figuring out the moderation buttons had been shifted and just needed moving back into place, I'm wondering if it could be fixed with some similar thinking, so I've attached the Display.template file I'm using in case it can be debugged at first glance?

Shambles

You can rule out/in any JS conflicts using your browser developer tools - there should be a JS console debugger in there.

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on July 21, 2015, 10:33:47 AM
Which theme is it?

It based on default, but it is my own custom :D

Quote from: Shambles on July 21, 2015, 10:02:18 AM
You can rule out/in any JS conflicts using your browser developer tools - there should be a JS console debugger in there.

I couldn't see anything unusual in there, I just get:
Uncaught TypeError: Cannot read property 'innerHTML' of nullgetInnerHTML @ script.js?fin20:484QuickModify.onMessageReceived @ topic.js:277oMyDoc.onreadystatechange @ script.js?fin20:88

Kindred

well, that would be a problem, since I suspect that area is indeed the area generating the AJAX/inline quick edit...
Сл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."

live627

topic.js

remove

// Replace the subject part.
this.oCurSubjectDiv = document.getElementById('subject_' + this.sCurMessageId.substr(4));
this.sSubjectBuffer = getInnerHTML(this.oCurSubjectDiv);

sSubjectText = XMLDoc.getElementsByTagName('subject')[0].childNodes[0].nodeValue.replace(/\$/g, '{&dollarfix;$}');
setInnerHTML(this.oCurSubjectDiv, this.opt.sTemplateSubjectEdit.replace(/%subject%/, sSubjectText).replace(/\{&dollarfix;\$\}/g, '$'));

samborabora

Quote from: live627 on July 21, 2015, 10:36:35 PM
topic.js

remove

// Replace the subject part.
this.oCurSubjectDiv = document.getElementById('subject_' + this.sCurMessageId.substr(4));
this.sSubjectBuffer = getInnerHTML(this.oCurSubjectDiv);

sSubjectText = XMLDoc.getElementsByTagName('subject')[0].childNodes[0].nodeValue.replace(/\$/g, '{&dollarfix;$}');
setInnerHTML(this.oCurSubjectDiv, this.opt.sTemplateSubjectEdit.replace(/%subject%/, sSubjectText).replace(/\{&dollarfix;\$\}/g, '$'));


'fraid that didn't work  :-[ I'm getting a bit of this:
chrome-extension://boadgeojelhgndaghljhdicfkmllpafd/cast_sender.js Failed to load resource: net::ERR_FAILED
2chrome-extension://dliochdbjfkdbacpmhlcpmleaejidimm/cast_sender.js Failed to load resource: net::ERR_FAILED
script.js:100 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
2chrome-extension://hfaagokkkhdbgiakmmlclaapfelnkoah/cast_sender.js Failed to load resource: net::ERR_FAILED
2chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj/cast_sender.js Failed to load resource: net::ERR_FAILED
2chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js Failed to load resource: net::ERR_FAILED
2chrome-extension://eojlgccfgnjlphjnlopmadngcgmmdgpk/cast_sender.js Failed to load resource: net::ERR_FAILED

but I can't see those are related. I click modify and I get:
Uncaught TypeError: Cannot read property 'innerHTML' of nullgetInnerHTML @ script.js?fin20:484QuickModify.onMessageReceived @ topic.js:277oMyDoc.onreadystatechange @ script.js?fin20:88

I just kept the logs on, and I missed this error:
Uncaught TypeError: Cannot read property 'innerHTML' of nullgetInnerHTML @ script.js?fin20:484QuickModify.onMessageReceived @ topic.js:277oMyDoc.onreadystatechange @ script.js?fin20:88
Uncaught TypeError: Cannot read property 'value' of undefinedQuickModify.modifySave @ topic.js:313onclick @ index.php?topic=186.0:1
Uncaught TypeError: Cannot read property 'value' of undefinedQuickModify.modifySave @ topic.js:313onsubmit @ index.php?topic=186.0:417

Here's my topic.js attached (with the part you mentioned hash out, live).

samborabora

Quote from: Kindred on July 21, 2015, 01:15:39 PM
well, that would be a problem, since I suspect that area is indeed the area generating the AJAX/inline quick edit...

It's strange because it shows the editor box and makes out it has worked, it just doesn't show on refresh.

margarett

Yeah it's the AJAX update which isn't working.

Your Display.template.php is heavily modified so it's not easy to track changes.
Yet, you have a new block of code in the JS bits:
aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "display_jump_to",
sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
iCurBoardId: ', $context['current_board'], ',
iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
sCurBoardName: "', $context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
sGoButtonLabel: "', $txt['go'], '"
});

Anyway, let's trace this by parts.
Please backup your file and load a clean Display.template.php. Then try again and let us know
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on July 22, 2015, 05:41:34 PM
Yeah it's the AJAX update which isn't working.

Your Display.template.php is heavily modified so it's not easy to track changes.
Yet, you have a new block of code in the JS bits:
aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "display_jump_to",
sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
iCurBoardId: ', $context['current_board'], ',
iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
sCurBoardName: "', $context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
sGoButtonLabel: "', $txt['go'], '"
});

Anyway, let's trace this by parts.
Please backup your file and load a clean Display.template.php. Then try again and let us know

I replaced mine with the default, and I modify and click save, and it reloads the page and it hasn't changed. And yet it DOES work if I use the whole default theme, rather than just switching out the Display.template. Is there some other file that might be controlling this in the theme?

Advertisement: