Item8658: The publish results page is munged particularly when publishing to HTML (file or PDF)
| Priority: |
CurrentState: |
AppliesTo: |
Component: |
WaitingFor: |
| Normal |
Closed |
Extension |
PublishPlugin |
|
Plugin version: 6222 (2010-02-05)
Installation File Timestamp: 24 Feb 2010 - 19:13
When publishing to a file or PDF, /rest/PublishPlugin/publish returns a munged output page which begins:
(default.htm, index.html)Published sitemap.xml<br /><!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Foswiki: Publish</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"><head>
<link rel="stylesheet" href="http://wiki.mot.com/pub/System/HeadlinesPlugin/style.css" type="text/css" media="all" />
<title> Publish < PublishPlugin < Foswiki</title>
[...]
The plain text preceding the DOCTYPE causes the page to be rendered as text and the raw HTML for the rest of the page displayed.
Publishing to a .zip or .tgz also produces a munged results page but less obviously so as the browser seems to recover and still render the page as HTML.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Foswiki: Publish</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"><head>
<link rel="stylesheet" href="http://wiki.mot.com/pub/System/HeadlinesPlugin/style.css" type="text/css" media="all" />
<title> Publish < PublishPlugin < Foswiki</title>
[...]
In all cases, the page contains multiple DOCTYPE, html, head, and body elements. The duplicate html and body elements are not closed.
The web is published, it is just the results page that is munged.
--
BryanThale - 03 Mar 2010
The
file and
ftp backends use
print where I think they should use
$this->{logger}->logInfo. (The
pdf backend derives from the
file backend and so it inherits the problem from
file .) See
here for the origin of
(default.htm, index.html).
Crawford - I can fix this easily, provided that I have understood the problem correctly.
--
MichaelTempest - 24 Oct 2010
We discussed this on IRC - the print is doing a $response->print, not to the logger. UI/Statistics has the pattern.
--
CrawfordCurrie - 30 Oct 2010
Sorry, Crawford, I forgot to update this topic.
I can confirm that
$this->{logger} is a Foswiki::Plugins::PublishPlugin::Publisher object, and it implements the logInfo method I referred to. The Publisher follows the same pattern as UI/Statistics.
--
MichaelTempest - 30 Oct 2010