Fetching Preview Issue with Sef on

Started by oSa, December 01, 2006, 06:52:13 AM

Previous topic - Next topic

oSa

Hi Ortsio, i have encountered another problem, this time: fetching preview issue. I get this error message:

Error: XMLDoc.getElementsByTagName("smf")[0] has no properties
Source File: http://www.artifm.net/component/option,com_smf/Itemid,26/action,post/topic,10.15/num_replies,24/lang,tr
Line: 526

The solution you have proposed in this topic works in the expense of quote and inline edit functions. I wonder if there is a solution which won't cause any conflicts among these functions?

smf 1.1rc3, joomla 1.0.11, bridge 1.1.6, joomla sef on, smf sef off, everything is ok in stand alone forum

Orstio

Can I see what it looks like when you apply that fix?  It appears this has something to do with Joom!Fish again...

oSa

i'll wait for you to be online since i don't want to apply the fix and wait with problems.

a quick question: Does the brigde 1.1.6 work with smf 1.1 final?

Orstio

QuoteDoes the brigde 1.1.6 work with smf 1.1 final?

Yes.

oSa

#4
I have applied the fix, now quote and inline edit stopped working, but preview is ok.

Edit:Firefox error
Error: XMLDoc.getElementsByTagName("message")[0] has no properties
Source File: http://www.artifm.net/forum/Themes/default/xml_topic.js
Line: 62

and also

Error: mismatched tag. Expected: </tr>.
Source File: http://www.artifm.net/component/option,com_smf/Itemid,26/lang,tr?action=quotefast;quote=1031;sesc=b955a7d6a427dad011cd9a1ba82af524;modify;xml
Line: 4, Column: 6
Source Code:
         </td>--------------------------^

Orstio

In your Themes/default folder, you will find a file named xml_topic.js.

You'll want to find this:

function doQuote(messageid, cur_session_id)
{
if (quickReplyCollapsed)
window.location.href = smf_scripturl + "?action=post;quote=" + messageid + ";topic=" + smf_topic + "." + smf_start + ";sesc=" + cur_session_id;
else
{
if (window.XMLHttpRequest)
{
if (typeof window.ajax_indicator == "function")
ajax_indicator(true);
getXMLDocument(smf_scripturl + "?action=quotefast;quote=" + messageid + ";sesc=" + cur_session_id + ";xml", onDocReceived);
}
else
reqWin(smf_scripturl + "?action=quotefast;quote=" + messageid + ";sesc=" + cur_session_id, 240, 90);

if (navigator.appName == "Microsoft Internet Explorer")
window.location.hash = "quickreply";
else
window.location.hash = "#quickreply";
}
}


and change it to this:

function doQuote(messageid, cur_session_id)
{
if (quickReplyCollapsed)
window.location.href = smf_scripturl + "/action,post/quote," + messageid + "/topic," + smf_topic + "." + smf_start + "/sesc," + cur_session_id;
else
{
if (window.XMLHttpRequest)
{
if (typeof window.ajax_indicator == "function")
ajax_indicator(true);
getXMLDocument(smf_scripturl + "/action,quotefast/quote," + messageid + "/sesc," + cur_session_id + "/xml,xml", onDocReceived);
}
else
reqWin(smf_scripturl + "/action,quotefast/quote," + messageid + "/sesc," + cur_session_id, 240, 90);

if (navigator.appName == "Microsoft Internet Explorer")
window.location.hash = "quickreply";
else
window.location.hash = "#quickreply";
}
}


Then find this:

function modify_msg(msg_id, cur_session_id)
{
if (!window.XMLHttpRequest)
return;
if (typeof(window.opera) != "undefined")
{
var test = new XMLHttpRequest();
if (typeof(test.setRequestHeader) != "function")
return;
}
if (in_edit_mode == 1)
modify_cancel();
in_edit_mode = 1;
if (typeof window.ajax_indicator == "function")
ajax_indicator(true);
getXMLDocument(smf_scripturl + '?action=quotefast;quote=' + msg_id + ';sesc=' + cur_session_id + ';modify;xml', onDocReceived_modify);
}


and change it to this:

function modify_msg(msg_id, cur_session_id)
{
if (!window.XMLHttpRequest)
return;
if (typeof(window.opera) != "undefined")
{
var test = new XMLHttpRequest();
if (typeof(test.setRequestHeader) != "function")
return;
}
if (in_edit_mode == 1)
modify_cancel();
in_edit_mode = 1;
if (typeof window.ajax_indicator == "function")
ajax_indicator(true);
getXMLDocument(smf_scripturl + '/action,quotefast/quote,' + msg_id + '/sesc,' + cur_session_id + '/modify,modify/xml,xml', onDocReceived_modify);
}

oSa

Thanks, the problem is solved now.

It would be very hard to upgrade to 1.1 final because of all these modifications :(

Orstio

What else have you changed in SMF?

The bridge doesn't need to change for the upgrade to SMF 1.1.

oSa

Doesn't the upgrade change files like xml_topic.js?

Orstio

Yes, I'm just wondering what other changes you've made to SMF?  If all the other changes were to the bridge, you have nothing to worry about, because you don't need to change your bridge.

oSa

I'll check them, but for now i've just saw another problem with inline edit. Edit box appears but you can't save. Cancel works ok ???

Orstio

I suppose I should just release a modified Theme file.   :-\

xml_topic.js again:

function modify_save(cur_session_id)
{
if (!in_edit_mode)
return true;

var i, x = new Array();
x[x.length] = 'subject=' + escape(textToEntities(document.forms.quickModForm['subject'].value.replace(/&#/g, "&#"))).replace(/\+/g, "%2B");
x[x.length] = 'message=' + escape(textToEntities(document.forms.quickModForm['message'].value.replace(/&#/g, "&#"))).replace(/\+/g, "%2B");
x[x.length] = 'topic=' + parseInt(document.forms.quickModForm.elements['topic'].value);
x[x.length] = 'msg=' + parseInt(document.forms.quickModForm.elements['msg'].value);

if (typeof window.ajax_indicator == "function")
ajax_indicator(true);

sendXMLDocument(smf_scripturl + "?action=jsmodify;topic=" + smf_topic + ";sesc=" + cur_session_id + ";xml", x.join("&"), modify_done);

return false;
}


Change to:

function modify_save(cur_session_id)
{
if (!in_edit_mode)
return true;

var i, x = new Array();
x[x.length] = 'subject=' + escape(textToEntities(document.forms.quickModForm['subject'].value.replace(/&#/g, "&#"))).replace(/\+/g, "%2B");
x[x.length] = 'message=' + escape(textToEntities(document.forms.quickModForm['message'].value.replace(/&#/g, "&#"))).replace(/\+/g, "%2B");
x[x.length] = 'topic=' + parseInt(document.forms.quickModForm.elements['topic'].value);
x[x.length] = 'msg=' + parseInt(document.forms.quickModForm.elements['msg'].value);

if (typeof window.ajax_indicator == "function")
ajax_indicator(true);

sendXMLDocument(smf_scripturl + "/action,jsmodify/topic," + smf_topic + "/sesc," + cur_session_id + "/xml,xml", x.join("&"), modify_done);

return false;
}

oSa

The code in my file was different:
function modify_save(cur_session_id)
{
   if (!in_edit_mode)
      return true;

   var i, x = new Array();
   x[x.length] = 'subject=' + escape(textToEntities(document.forms.quickModForm['subject'].value.replace(/&#/g, "&#38;#"))).replace(/\+/g, "%2B");
   x[x.length] = 'message=' + escape(textToEntities(document.forms.quickModForm['message'].value.replace(/&#/g, "&#38;#"))).replace(/\+/g, "%2B");
   x[x.length] = 'topic=' + parseInt(document.forms.quickModForm.elements['topic'].value);
   x[x.length] = 'msg=' + parseInt(document.forms.quickModForm.elements['msg'].value);

   if (typeof window.ajax_indicator == "function")
      ajax_indicator(true);

   sendXMLDocument(smf_scripturl + "?action=jsmodify;topic=" + smf_topic + ";sesc=" + cur_session_id + ";xml", x.join("&"), modify_done);

   return false;
}
There are 38s in the code???

Orstio

& # 38 ; is correct.  This board converted it in my post.  :P

oSa

I've realised that they were converted but i couldn't c/p your modified code for that reason :) Instead i've just changed this part of the code:
sendXMLDocument(smf_scripturl + "/action,jsmodify/topic," + smf_topic + "/sesc," + cur_session_id + "/xml,xml", x.join("&"), modify_done);

I suppose there wasn't any other modifications as it has solved the save issue.

QuoteI suppose I should just release a modified Theme file.
BTW, i wonder if these problems are general issues or rare ones ???

Orstio

I think they are related to the modified URLs made by Joom!Fish, though I can see this being problematic in other ways, even if the functionality does actually work.

Any browser that has javascript error reporting pop-ups should show something on posting, for example.  That could be very annoying for users.

Advertisement: