Advertisement:

Author Topic: Fetching Preview Issue with Sef on  (Read 8311 times)

Offline oSa

  • Jr. Member
  • **
  • Posts: 155
  • Gender: Male
  • FM Expert
Fetching Preview Issue with Sef on
« on: December 01, 2006, 06:52:13 AM »
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
« Last Edit: December 02, 2006, 07:24:53 PM by Orstio »

Orstio

  • Guest
Re: Fetching Preview Issue with Sef on
« Reply #1 on: December 01, 2006, 06:26:03 PM »
Can I see what it looks like when you apply that fix?  It appears this has something to do with Joom!Fish again...

Offline oSa

  • Jr. Member
  • **
  • Posts: 155
  • Gender: Male
  • FM Expert
Re: Fetching Preview Issue with Sef on
« Reply #2 on: December 02, 2006, 11:40:34 AM »
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

  • Guest
Re: Fetching Preview Issue with Sef on
« Reply #3 on: December 02, 2006, 12:23:50 PM »
Quote
Does the brigde 1.1.6 work with smf 1.1 final?

Yes.

Offline oSa

  • Jr. Member
  • **
  • Posts: 155
  • Gender: Male
  • FM Expert
Re: Fetching Preview Issue with Sef on
« Reply #4 on: December 02, 2006, 01:04:34 PM »
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>--------------------------^
« Last Edit: December 02, 2006, 01:06:55 PM by oSa »

Orstio

  • Guest
Re: Fetching Preview Issue with Sef on
« Reply #5 on: December 02, 2006, 03:49:55 PM »
In your Themes/default folder, you will find a file named xml_topic.js.

You'll want to find this:

Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
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);
}

Offline oSa

  • Jr. Member
  • **
  • Posts: 155
  • Gender: Male
  • FM Expert
Re: Fetching Preview Issue with Sef on
« Reply #6 on: December 02, 2006, 05:48:05 PM »
Thanks, the problem is solved now.

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

Orstio

  • Guest
Re: [Solved] Fetching Preview Issue with Sef on
« Reply #7 on: December 02, 2006, 05:52:27 PM »
What else have you changed in SMF?

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

Offline oSa

  • Jr. Member
  • **
  • Posts: 155
  • Gender: Male
  • FM Expert
Re: [Solved] Fetching Preview Issue with Sef on
« Reply #8 on: December 02, 2006, 06:09:16 PM »
Doesn't the upgrade change files like xml_topic.js?

Orstio

  • Guest
Re: [Solved] Fetching Preview Issue with Sef on
« Reply #9 on: December 02, 2006, 06:10:35 PM »
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.

Offline oSa

  • Jr. Member
  • **
  • Posts: 155
  • Gender: Male
  • FM Expert
Re: [Solved] Fetching Preview Issue with Sef on
« Reply #10 on: December 02, 2006, 06:22:55 PM »
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

  • Guest
Re: Fetching Preview Issue with Sef on
« Reply #11 on: December 02, 2006, 06:36:44 PM »
I suppose I should just release a modified Theme file.   :-\

xml_topic.js again:

Code: [Select]
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:

Code: [Select]
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;
}

Offline oSa

  • Jr. Member
  • **
  • Posts: 155
  • Gender: Male
  • FM Expert
Re: Fetching Preview Issue with Sef on
« Reply #12 on: December 02, 2006, 06:44:56 PM »
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

  • Guest
Re: Fetching Preview Issue with Sef on
« Reply #13 on: December 02, 2006, 06:53:05 PM »
& # 38 ; is correct.  This board converted it in my post.  :P

Offline oSa

  • Jr. Member
  • **
  • Posts: 155
  • Gender: Male
  • FM Expert
Re: Fetching Preview Issue with Sef on
« Reply #14 on: December 02, 2006, 07:07:15 PM »
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:
Code: [Select]
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.

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

Orstio

  • Guest
Re: Fetching Preview Issue with Sef on
« Reply #15 on: December 02, 2006, 07:23:25 PM »
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.