Ticket #1426 (closed Bug: fixed)

Opened 7 years ago

Last modified 5 years ago

Error loading fckstyles.xml

Reported by: l_wang Owned by: martinkou
Priority: Normal Milestone: FCKeditor 2.6.1
Component: General Version: FCKeditor 2.4.3
Keywords: Confirmed Review+ Cc:

Description

When I open sample01.html, error loading fckstyles.xml is popped out. http://wiki.fckeditor.net/Developer's_Guide/Configuration/Styles mentions that: The fix was simple to set this header explicitly.

@headersContent-Type? = "application/xml" render :action => 'fckstyles'

Which file do I need to modify?

Thanks.

Attachments

1426.patch (2.5 KB) - added by martinkou 7 years ago.
1426_2.patch (575 bytes) - added by martinkou 7 years ago.

Change History

comment:1 Changed 7 years ago by w.olchawa

  • Keywords Pending WorksForMe added

Hi!

I was unable to reproduce your bug. Sample1 works on all of the browsers in my case.

Let me introduce you to this page:http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Styles

were you will find all of the information about appyling xml styles in FCKeditor.

Please let us know if the problem still occurs in the newest 2.5.1 version.

Thanks.

comment:2 Changed 7 years ago by mcleod@…

I have the same error with the nightly build of 2.6.x

Also with 2.6rc.

It applies to both IE7 and FireFox.

My point is, even if you can configure it somehow, the examples work on the fck site, they do not work on my downloaded examples, unless I change fckxml_ie.js:

		//if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
			//this.DOMDocument = oXmlHttp.responseXML ;
		//else 
		if (oXmlHttp.status == 200 || oXmlHttp.status == 304 ||( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ))
		{
			this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
			this.DOMDocument.async = false ;
			this.DOMDocument.resolveExternals = false ;
			this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
		}

The commented parts show what I changed. The point in my case is that if the response header is 200/OK, the oXmlHttp.responseXML object is undefined, while oXmlHttp.responseText is correct.

I wonder how you manage to get it working on your site, so I will read the configuration part.

comment:3 Changed 7 years ago by martinkou

  • Keywords Discussion added

I'm not really sure why the current XMLHttpRequest processing code is written like it currently is. But I think using the DOMDocument.loadXML() function as a fallback in case responseXML doesn't work should be reasonable.

comment:4 Changed 7 years ago by martinkou

#1426 is marked as a dup to this ticket.

comment:5 Changed 7 years ago by fredck

  • Keywords Confirmed added; Pending WorksForMe Discussion removed
  • Milestone set to FCKeditor 2.6.1

I'm not able to reproduce it too, but it seems its is related to the server configurations. The XML files are not being served as text/xml.

In any case, a fall back solution to use loadXML seems reasonable, so we can take a look at it for the next version.

comment:6 Changed 7 years ago by wwalc

If you're running apache, to reproduce this issue, add this to .htaccess:

Addtype plain/text .xml

(I assume that AllowOverride is enabled.) If AllowOverride is disabled, add this setting to httpd.conf and restart your web server.

comment:7 Changed 7 years ago by martinkou

  • Owner set to martinkou
  • Status changed from new to assigned

Changed 7 years ago by martinkou

comment:8 Changed 7 years ago by martinkou

  • Keywords Review? added

Thanks for the tip Wiktor. I've written a patch to fix this issue.

comment:9 Changed 7 years ago by mcleod@…

Thanks for the patch!

I also found a workaround, won't be useful anymore I guess, but who knows will be happy with it. If you server your xml through php, which may be the cause of the error, you can add two headers: <?php header('Content-Type: text/xml',true) ?> <?php header('Status: 4',true) ?>

The second parameter takes care of replacting existing headers, if any. Of course it is probably better to use the patch.

comment:10 Changed 7 years ago by w.olchawa

#2101 has been marked as DUP

comment:11 Changed 7 years ago by wwalc

I'm not a JavaScript expert, but this patch works fine on my computer in IE6 and Firefox, so a little Review+ from me ;)

comment:12 Changed 7 years ago by alfonsoml

  • Keywords Review+ added; Review? removed

comment:13 Changed 7 years ago by martinkou

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed with [1921].

Click here for more info about our SVN system.

comment:14 Changed 7 years ago by martinkou

  • Status changed from closed to reopened
  • Keywords Review+ removed
  • Resolution fixed deleted

Reopened because the fix is causing the XML loading error to occur when IE is opening the samples from local harddisk.

comment:15 Changed 7 years ago by martinkou

The XMLHttp object created by IE6 returns an empty XML document for responseXML when it's requesting a document on the local filesystem. I've added a check against that in IE's fallback logic in the new patch.

Changed 7 years ago by martinkou

comment:16 Changed 7 years ago by martinkou

  • Keywords Review? added

comment:17 Changed 7 years ago by alfonsoml

  • Keywords Review+ added; Review? removed

comment:18 Changed 7 years ago by martinkou

  • Status changed from reopened to closed
  • Resolution set to fixed

Fixed with [1932].

Click here for more info about our SVN system.

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy