#1770: On save/preview we just see an empty preview
--------------------------------------------+-------------------------------
Reporter: TheDevilOnLine | Owner:
Type: Bug | Status: new
Priority: Normal | Milestone:
Component: Project : MediaWiki+FCKeditor | Version:
Resolution: | Keywords: WorksForMe
--------------------------------------------+-------------------------------
Comment (by theonlyzby):
I encountered the exact same problem. I had the impression there is a mix
between the POST data information present in the FORM and the
action="index.php?title=test&action=submit". So I decided to filter is
&action=submit out of the URL to place it as hidden value, which seems to
work ... for us at least!;-)
So, find the following code block into EditPage.php (into includes
directory):[[BR]]
(Tip: The error is around the <form id= , so search for this.)
{{{
$safemodehtml = $this->checkUnicodeCompliantBrowser()
? '' : Xml::hidden( 'safemode', '1' );
$wgOut->addHTML( <<<END
{$toolbar}
<form id="editform" name="editform" method="post" action="$action"
enctype="multipart/form-data">
END
);
if( is_callable( $formCallback ) ) {
call_user_func_array( $formCallback, array(
&$wgOut ) );
}
wfRunHooks( 'EditPage::showEditForm:fields', array(
&$this, &$wgOut ) );
// Put these up at the top to ensure they aren't lost on
early form submission
$wgOut->addHTML( "
<input type='hidden' value=\"" . htmlspecialchars( $this->section ) . "\"
name=\"wpSection\" />
}}}
And replace it by:
{{{
$safemodehtml = $this->checkUnicodeCompliantBrowser()
? '' : Xml::hidden( 'safemode', '1' );
// HeBo MOD Preview Bug
//$action = "/wiki/index.php?title=Secure_UC"; ... Removes &action=submit
$action_post= "";
$action_before = $action;
$action = str_replace("&action=submit","",$action);
if ($action_before!=$action) {
$action_post = "<input type='hidden' name=\"action\" value=\"submit\"
/>";
}
$wgOut->addHTML( <<<END
{$toolbar}
<form id="editform" name="editform" method="post" action="$action"
enctype="multipart/form-data">
END
);
if( is_callable( $formCallback ) ) {
call_user_func_array( $formCallback, array(
&$wgOut ) );
}
wfRunHooks( 'EditPage::showEditForm:fields', array(
&$this, &$wgOut ) );
// Put these up at the top to ensure they aren't lost on
early form submission
$wgOut->addHTML( "
" . $action_post ."
<input type='hidden' value=\"" . htmlspecialchars( $this->section ) . "\"
name=\"wpSection\" />
}}}
I hope this will help, Henry2.0
--
Ticket URL: <http://dev.fckeditor.net/ticket/1770#comment:5>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac