Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#1426 closed Bug (fixed)

Error loading fckstyles.xml

Reported by: Julian Wang Owned by: Martin Kou
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 (2)

1426.patch (2.5 KB) - added by Martin Kou 9 years ago.
1426_2.patch (575 bytes) - added by Martin Kou 9 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 9 years ago by Wojciech 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 9 years ago by Bart 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 9 years ago by Martin Kou

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 9 years ago by Martin Kou

#1426 is marked as a dup to this ticket.

comment:5 Changed 9 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added; Pending WorksForMe Discussion removed
Milestone: 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 9 years ago by Wiktor Walc

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 9 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

Changed 9 years ago by Martin Kou

Attachment: 1426.patch added

comment:8 Changed 9 years ago by Martin Kou

Keywords: Review? added

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

comment:9 Changed 9 years ago by Bart 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 9 years ago by Wojciech Olchawa

#2101 has been marked as DUP

comment:11 Changed 9 years ago by Wiktor Walc

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 9 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review+ added; Review? removed

comment:13 Changed 9 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [1921].

Click here for more info about our SVN system.

comment:14 Changed 9 years ago by Martin Kou

Keywords: Review+ removed
Resolution: fixed
Status: closedreopened

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

comment:15 Changed 9 years ago by Martin Kou

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 9 years ago by Martin Kou

Attachment: 1426_2.patch added

comment:16 Changed 9 years ago by Martin Kou

Keywords: Review? added

comment:17 Changed 9 years ago by Alfonso Martínez de Lizarrondo

Keywords: Review+ added; Review? removed

comment:18 Changed 9 years ago by Martin Kou

Resolution: fixed
Status: reopenedclosed

Fixed with [1932].

Click here for more info about our SVN system.

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