RichEditBugs

I have installed Richedit on my server (Apache2 with perl module) and when I try to edit a page I'll get no error, but also no edit page; only the right menu, the page title and immediatly after that, the footer of the page.

I'm missing something?

2006/December/07 Mitsuhashi (mitsuhashi_DOT_da_AT_gmail_DOT_com)


I have installed RichEdit on my server with ActivePerl. The textbox appears as expected, however, any pre-existing text does not populate in the textbox. Also, nothing entered into the RichEdit box is saved to the page. This happens regardless of which web browser is used.

In Firefox the JavaScript Console reports the following error:

Error: [Exception... "'Permission denied to get property HTMLDocument.title' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]

I am not sure if this is the root cause of the problem. Any help is appreciated. Thank you.

SAME Problem, without any javascript error message
Using:
Apache 2.0.55
ActivePerl 5.8.7.815
PHP 5.1.1

Problem by EW:

Tried to install it on XAMP-Installation.
But allway i try to edit a page i get simply a mess of html code presented instead of
something wysiwyg like. (Opera using)
I tried also to browse and edit with via IE, same results.
Javascript and cookies are enabled?!


  • Using ActivePerl: HTML Parser and HTML Tree are both included in the core
  • URI module has been installed, and the perl scripts packaged with RichEdit (WikiConverter) have been placed in a dir with execute access.. /pmwiki/cgi
  • Have placed relevant include statements into config, and set the PerlDirectory variable.
Problem:
  • the HTML -> Wiki side of this script does not seem to be functioning correctly with this setup. Am currently using Gemini-Two/FixFlow skin
Reasoning:
  • Parts of Line 8 onwards from RichEdit.Editform is printed to screen in large block letters in front of each of the elements.

copy and paste from screen output

Editing Main.HomePage %25block class=wikiaction%25%0a%0a
(:table cellspacing='0' cellpadding='0' bgcolor='#eeeeff' style='font-size:12px; font-family:Arial;' bgcolor='#eeeeff':)%0a
(:cellnr:)This wiki now features a word processor style editor which allows you to see your formatting without needing to use 
Save or Preview. You can also paste from word processors such as Microsoft Word, 
OpenOffice.org, WordPad, or even other web pages.%0a%0a
* If you are having problems, or would simply prefer to use a plain text editor, click here.%0a%0a
* To learn more about the rich text editor, click here.%0a
(:tableend:)%0a%0a(:messages:)%0a
(:div id='wikiedit':)%0a

After the above output, the original GuiEdit icons are rendered. then \\%0a, then the TinyMCE box, etc... dw September 22, 2005, at 02:02 AM

Do you mean you're seeing this when you try to edit a page, or it's getting saved in place of your edited wiki page? --Russell
This shows up on the edit page; as can be seen here:
--dw
Weird... the newlines are being displayed as character codes. Are you using the new UTF-8 encoding or something which might affect character encoding? Did you make any adjustments to the RichEdit.EditForm form? --Russell


Negative, This is why I think it points to a problem with the Perl scripts used to convert from HTML to pmwiki markup.
  • Have reverted to a vanilla flavoured (unchanged) config.php; with the only additions being the following lines:
    • $PageEditForm = "RichEdit.EditForm";
    • $RichEdit_PerlDirectory = "cgi\\";
    • include_once('cookbook/richedit.php');
    • include_once('cookbook/wikistylesascss.php');
Hm. The HTML -> Wiki conversion doesn't have anything to do with the edit form display, though. It's only called on save. So there's got to be something else going on here.
--Russell September 27, 2005, at 08:38 AM
I thought maybe I wasn't setting $RichEdit_PerlDirectory correctly, but testing showed it was definatley pointing to the right spot.. Which is a Bad ThingTM I guess - meaning the perl scripts aren't working.. all the other CPAN modules work fine; just can't seem to get the html to wiki parser going. thanks, btw
dw September 25, 2005, at 06:20 PM
Further information pointing to problems with the wikiconverter perl script, this is the error output when attempting to save a page despite the strange markup.

Warning: exec(): Unable to fork [echo ""| cgi\WikiConverterWrapper.pl] in c:\inetpub\wwwroot\wiki\cgi\WikiConverter.php on line 22

Warning: Invalid argument supplied for foreach() in c:\inetpub\wwwroot\wiki\cgi\WikiConverter.php on line 27

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\wiki\cgi\WikiConverter.php:22) in c:\inetpub\wwwroot\wiki\pmwiki.php on line 682

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\wiki\cgi\WikiConverter.php:22) in c:\inetpub\wwwroot\wiki\pmwiki.php on line 683

dw September 25, 2005, at 10:51 PM
I'd ask your ISP about that first error- I'm wondering if there's a permissions problem. I notice, btw, that you're on a Windows system. Someone on the mailing list had some difficulties getting it set up on Windows, and managed to resolve them. Here's what Sproaticus had to say:
Two changes I made to make this go away: 

1: (I mentioned this earlier but without detail) I needed to change
one line in WikiConverter.php

   $CGISCRIPT = "perl.exe " . $RichEdit_PerlDirectory .
'WikiConverterWrapper.pl';

...for some reason, PHP was not calling the Perl interpreter even
though Windows has the .pl extension associated with perl.exe.  (The
funny part is, it works in the command line without specifically
calling perl.exe.)  The $CGISCRIPT variable may need to be set in
config.php

This change started giving me Perl error text in the output, the
missing "descendents.al" file.  Which led me to...

2: Upgrading my ActivePerl from 5.6.1 build 635, to build 638.  After
this, the save function started working.
Thanks again.. no ISP involved as this wiki is running on an intranet; i'm using:
  • Windows 2000 Server with IIS
  • ActivePerl 5.6.1.638
  • Unmodified version of PMWiki, default skin - only changes are to include RichEdit in config.php
  • unmodified version of RichEdit - have tried modifying $CGISCRIPT as per above example, but changed nothing as Perl was associated correctly..

Have tried all of the above and currently haven't made any progress; going to try and move over to ActivePerl 5.8, see if anything changes at all. I completely fail to understand why it's rendering the unicode characters as plain text, especially seeing as you say it's not even touching PERL there. Perplexing. Good work so far though, and good luck with it. Where's this Mailing List? -- dw September 28, 2005, at 02:16 AM

I'm honestly not sure what's going on- RichEdit actually doesn't mess with the rendering of anything except WikiStyles. The mailing list is here.
--Russell September 28, 2005, at 01:06 PM

Problem : I'm using EnableGUIButtons = 1 and the buttons toolbar shows when i use RichEdit I would like it to disapear and reapear if i choose to use normal edit.

Nice to have : background color; and predefined styles;

Congrats : great piece of work !

Andre' Carvalho

Thanks! In RichEdit.EditForm, change (:e_guibuttons:) to (:if !richedit:)(:e_guibuttons:)(:ifend:)
--Russell September 28, 2005, at 01:06 PM

Problem1: Strange file paths when pmwiki located on other path than server root.

I had to make a hack to make richedit work on my server. I tried to locate the problem more exact, but I failed as I don't have enough time. I'm guessing that the problem occurs because my pmwiki-root is not physically located in my server root path, because my server root path keep appearing in the server logs.

My set up looks similar to this:
http://www.example.com/ is located in /usr/local/webroot
http://www.example.com/wiki is located in /usr/local/www/data/pmwiki

If my hack is disabled I get errors like this in my http-error.log:

File does not exist: /usr/local/wwwroot/cookbook/richedit/tinymce/jscripts/tiny_mce/tiny_mce_gzip.php
File does not exist: /usr/local/wwwroot/cookbook/richedit/tinymce_config.js

It does not help if I explicity set Richedit_WikiDir to /usr/local/www/data/pmwiki, this only gets appended to server root path. But if i set $RichEdit_Editor_TinyMCE_ScriptUrl, $RichEdit_Editor_TinyMCE_ConfigScriptUrl and $RichEdit_ContentCSS (the last file shows up as an error in http-error.log only when the two first are fixed) to "../cookbook/richedit/..." i get everything to work.

Problem2: I can't set the editor back to richedit after I've set it to plaintext once.

I've tried to debug this myself. But I ended up with nothing. The only solution I've found is to remove the cookies.

bengibollen October 15, 2005, at 09:25 AM


Hi there, yet another problem, and very strange. In addition to problem 1 reported before, which i like that as well, i now discovered something else: Excerpt from my apache error log:

[Wed Oct 19 01:15:07 2005] [crit] [client xxxxxxxxxxx] (13)Permission denied: /var/www/staging/pmwiki/cookbook/richedit/tinymce/jscripts/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: [(approve links) edit diff]

[Wed Oct 19 01:15:07 2005] [error] [client xxxxxxxxxxx] client denied by server configuration: /var/www/staging/pmwiki/cookbook/richedit/tinymce_config.js, referer: [(approve links) edit diff]

I couldn't find a .htaccess there, so I created one that is world-readable just to make sure, but didn't work. Suggestions greatly appreciated. I have the cleanUrl recipe set up, could the whole rewriting-stuff have anything to do with that?

Thanks in advance. florian


I'm not seeing the edit box, and when trying -bash-2.05b# ./WikiConverterWrapper.pl Required 'dialect' parameter is missing at WikiConverter.pm line 15. So, something is amiss??

---

Is this RichEdit still in development ? I am trying to install it but have many problems and I can see support is no more available ? No answer from Russel after the 28 september.


I've a question here:

I put the cgi-bin/ in the same dir as cookbook/. The configuration the RichEdit is as follows:

$RichEdit_PerlDirectory='cgi-bin/';
include_once('cookbook/richedit.php');
include_once('cookbook/wikistylesascss.php');
$PageEditForm = 'RichEdit.EditForm';

When I test it on a page, error occurs after I click the "save" botton:

  • Warning: chdir() [function.chdir]: No such file or directory (errno 2) in D:\LocalSite\myhome\cgi-bin\WikiConverter.php on line 18
  • Warning: exec() [function.exec]: Unable to fork [echo ""| cgi-bin/WikiConverterWrapper.pl] in D:\LocalSite\myhome\cgi-bin\WikiConverter.php on line 22

and the original content of the page totally disappeared!

As to the first Warning, I checked WikiConverter.php, and replace the line 18 of
chdir("../cgi-bin/"); to:
chdir($RichEdit_PerlDirectory);

and test again:

  • Warning: exec() [function.exec]: Unable to fork [echo ""| cgi-bin/WikiConverterWrapper.pl] in D:\LocalSite\myhome\cgi-bin\WikiConverter.php on line 22

still nothing remains.

Is it the configuration problem or somthing else? thanks very much.

And I think the possible reason that all content will disappear is caused by the insecurity of exec() of Perl language. A new process starts when exec() is invoked while control will not be turned back to its caller.

liuxy

On my windows machine this was because it could not find the .pm file. I set the sitelib registry key to point to my cgi-bin and it worked perfectly from there.


Underlines don't seem to be supported all the way through. Same with "centered text".

That is, if you have a word doc with underlines, and you cut-n-paste it into the rich edit window, you still see the underlined text, nicely. Then, when you click "save", you don't really get WYSIWYG. Specific things that are gone include underscores, centered text, and most indenting.

Hopefully, this was the right place to list this bug. If not, my apologies.

- Anonymous


When installing on unix you will have to use dos2unix to convert all the CRLF to LF in at least the perl files. You'll need to do this if you get error log messages about "bad interpreter: /usr/bin/perl"

- bragi0