Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Chronic667 - helmikuu 03, 2006, 09:12:38 IP

Otsikko: AJAX editing bug
Kirjoitti: Chronic667 - helmikuu 03, 2006, 09:12:38 IP
A member of my forum found a bug in the AJAX reply editing.

Steps to reproduce:

- Open any topic you have replied in
- Click the quick edit button (https://www.simplemachines.org/community/Themes/simple/images/icons/modify_inline.gif)
- Click save
- Now, check the link to that reply, it should be incorrect with something like %msg_id% on the end

Refreshing the topic fixes this.

I also reported this bug here (http://www.simplemachines.org/community/index.php?topic=62731.msg470628#msg470628) but was told by JayBachatero that it works fine. However I tested it again on this forum on the Test Board and found the problem to still occur, ruling out a problem with my own forum.

Maybe its browser related? i'm using FireFox 1.5.0.1 this also happened with 1.5.0.

Otsikko: Re: AJAX editing bug
Kirjoitti: There's a Ferret - helmikuu 16, 2006, 01:30:22 IP
I just incurred in the same problem. Same browser, too.

Did you find a fix for that?
Otsikko: Re: AJAX editing bug
Kirjoitti: Daniel Hofverberg - helmikuu 17, 2006, 03:58:42 AP
I can confirm that I also have the same problem, both here and on my own forum. It seems to happen on all browsers (I have tried both IE and Opera), so it's not browser-dependent.

As far as I can make out, it seems to be a bug in RC2...
Otsikko: Re: AJAX editing bug
Kirjoitti: nwsw - helmikuu 17, 2006, 09:03:33 AP
This appears to be a bug. The fix requires a change in your Theme:

File: xml_topic.js, Function: onDocReceived_modify

The fix requires the following change to make %msg_id% a global replacement:


setInnerHTML(cur_msg_div, smf_template_body_edit.replace(/%body%/, text).replace(/%msg_id%/, cur_msg_id.substr(4)));


To:


setInnerHTML(cur_msg_div, smf_template_body_edit.replace(/%body%/, text).replace(/%msg_id%/g, cur_msg_id.substr(4)));


You will also have to take steps to make sure that the xml_topic.js is reloaded in your client's browser.
Otsikko: Re: AJAX editing bug
Kirjoitti: Compuart - helmikuu 17, 2006, 11:11:45 AP
Thanks for the fix.

! The title link wasn't updated properly after xmlHTTP editing of a message. (xml_topic.js)