Description
First observation: When HTTPAuth is used and a new page is created, the editor shows HTML markup that shouldn't be there.
After some discussion: In the KDE Konqueror web browser, the GUI editor does not fall back to text mode correctly. Note that the GUI editor is only called when creating new pages. For editing existing pages, only an edit link to text mode is offered.
Steps to reproduce
The bug disappears from my 1.8.0 RC 1 installation if I comment out the line
auth = [HTTPAuth(autocreate=True)]
in my wikiconfig.py. It only appears with KDE Konqueror web browser.
Example
Creating a TestPage with the ProjectTemplate shows the following in the editor:
<pre class="comment">## Please edit system and help pages ONLY in the master wiki!</pre><pre class="comment">## For more information, please see MoinMoin:MoinDev/Translation.</pre><pre class="comment">## IMPORTANT NOTE:</pre><pre class="comment">## When you use this page as a template for creating your project page:</pre><pre class="comment">## * please remove all lines starting with two hashes (##)</pre><pre class="comment">## * except the acl line, please keep that, but remove one hash, so it reads #acl ...</pre><pre class="comment">## * fix the acl line so it has the correct page instead of the sample Project/...Group</pre><pre class="comment">##acl Project/AdminGroup:admin,read,write,delete,revert Project/ReadWriteGroup:read,write Project/ReadGroup:read</pre><pre class="comment">##master-page:Unknown-Page</pre><pre class="comment">##master-date:Unknown-Date</pre><pre class="comment">#format wiki</pre><pre class="comment">#language en</pre>
Component selection
- general
this problem only applies to gui editor, not to text editor, right?
Good question. I located the output in PageGraphicalEditor.py, but I'm not sure
- whether what I have on screen right now is the GUI editor. There are buttons labelled Save Changes, Preview, Check Spelling, Cancel and other GUI elements. However, the main editing tasks are done in a big text edit box. Before "this problem only applies" I see forward slash, exclamation mark, backslash. Maybe my webbrowser has a problem with the GUI editor code and luckily the code provides a fallback to the text editor. That might explain why nobody else noticed the problem.
Still, the content of the JavaScript variable oFCKeditor.Value should not depend on the authentication method.
- whether what I have on screen right now is the GUI editor. There are buttons labelled Save Changes, Preview, Check Spelling, Cancel and other GUI elements. However, the main editing tasks are done in a big text edit box. Before "this problem only applies" I see forward slash, exclamation mark, backslash. Maybe my webbrowser has a problem with the GUI editor code and luckily the code provides a fallback to the text editor. That might explain why nobody else noticed the problem.
Please try with Firefox or Internet Explorer.
- Both browsers: Now I see a toolbar and the editor is wysiwhg, no raw wiki code anymore. The GUI editor
- uses the HTML markup, for example comments are shown in a different colour. With the code below, linebreaks and macros are not shown (potentially resulting in invalid HTML code).
The reason why this seemed to be linked to HTTPAuth is that anonymous users apparently are only offered the text mode editor (there even is no gui mode button), while authenticated users use the gui editor by default.
In KDE Konqueror 3.5.7 the oFCKeditor seems to fall back to a builtin text mode (and the GUI mode button is missing), but the fall back code does not handle the HTML markup intended for GUI mode correctly. It looks like the HTML markup feature was added after the fall back was implemented and it was forgotten to adjust the fall back code. A simple solution might be to simplify the fall back code to just explain the incompatibility and to show the "text mode" button only (or to automatically redirect to action=edit and editor=text).
I have tried konqueror 3.5.10 on http://moinmo.in/WikiSandBox. It doesn't show to me a link to the gui editor in the theme. The javascript compatibility code check for konqueror fails so it can't show the link right of the text editor.
- Is this different for your version?
- Do you use a different theme ?
No. Looks the same. There is only one link (action=edit and editor=text) on both my wiki and this wiki. I haven't tested it, but I assume that this calls the non-graphical PageEditor.py code. The PageGraphicalEditor.py code is executed when I create a new page as debugging output proves. That's why I'm talking about templates in the page title. This bug is only relevant because the template code is messed up. Of course, it would be nice to have a GUI editor in Konqueror, but I can live without one. The less experienced users probably use IE or Firefox and will be fine.
Do you have set the default editor to gui?
konqueror has a slightly different javascript engine and this one is currently not compatible with the javascript used by the gui editor. Because we don't know the users browsers (and version) we do test the capability of the used browser and do add the gui link if possible on this wiki. (This is also the default if you don't give a default editor). I have added some years ago already a bug report see, 68319, 48302 on the bug tracker of kde khtml. It may help if you add your vote also there. If one set the default browser to gui editor and uses a browser which can't start the editor the result you get may happen. But it is also not easy to add more checks and reject editing by a broken browser. If you use browsers which haven't implemented javascript well you better don't change the default so the text editor can work.
Thanks for following up on this. I documented the solution to set the preferences to text editor in section "Workaround" below. However, note that MoinMoin correctly detects unsupported browsers when editing existing pages (it then ignores the GUI preference), but doesn't do so when creating new pages. Imho, this inconsistent behaviour is a bug. If I understand the the JavaScript code in common.js correctly, the solution is very simple, assuming that editor=textonly and editor=guipossible are implemented. (There is a function that updates links that have name="editlink" from textonly to guipossible if the browser is supported by the GUI editor. However, another function seems to be used now that adds a GUI link after links with name="texteditlink".) Every link on the create page has to be extended by editor=textonly (part of the URL) and name="editlink" (a 2nd attribute of the anchor tag). Textonly sounds scarry, but doesn't switch off the GUI if the browser is supported because then the value is automatically changed to guipossible. Sorry that I cannot test this right now. -- Joachim
Details
MoinMoin Version |
1.8.0 beta3 and RC 1 |
OS and Version |
SuSE Linux 9.2 |
Python Version |
2.3.4 |
Server Setup |
Apache with plain CGI |
Server Details |
intranet with basic http auth |
Language you are using the wiki in (set in the browser/UserPreferences) |
en |
Workaround
Configure text mode editor for KDE Konqueror users.
Discussion
This bug is different from MoinMoinBugs/HTTPAuthCannotSave.
For discussion, see also section "Component selection" above.
Plan
- Priority:
- Assigned to:
- Status: