#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)
Change History (20)
comment:1 Changed 17 years ago by
Keywords: | Pending WorksForMe added |
---|
comment:2 Changed 17 years ago by
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 17 years ago by
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:5 Changed 17 years ago by
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 17 years ago by
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 17 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
Changed 17 years ago by
Attachment: | 1426.patch added |
---|
comment:8 Changed 17 years ago by
Keywords: | Review? added |
---|
Thanks for the tip Wiktor. I've written a patch to fix this issue.
comment:9 Changed 17 years ago by
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:11 Changed 17 years ago by
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 17 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:13 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with [1921].
Click here for more info about our SVN system.
comment:14 Changed 17 years ago by
Keywords: | Review+ removed |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Reopened because the fix is causing the XML loading error to occur when IE is opening the samples from local harddisk.
comment:15 Changed 17 years ago by
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 17 years ago by
Attachment: | 1426_2.patch added |
---|
comment:16 Changed 17 years ago by
Keywords: | Review? added |
---|
comment:17 Changed 17 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:18 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed with [1932].
Click here for more info about our SVN system.
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.