Wikka : WikkaBugsResolved

HomePage :: Categories :: Index :: Changes :: Comments :: Documentation :: Blog :: Login/Register
Most recent edit on 2008-06-24 02:18:34 by NilsLindenberg [archival note]

Additions:
This is an archival page from the earlier time of development. Please use only the Tracker for everything related to bugs or feature requests.

Deletions:
If you have encountered a problem and know of or want to propose a solution, do not post your solution here, but at WikkaBugs where it will be noted and reviewed by the Wikka developers and other Wikka users and may possibly improved or amended: an issue is not "resolved" until the solution has found its way into released or in to-be-released code!
 




Edited on 2008-01-28 00:16:01 by JavaWoman [Modified links pointing to docs server]

Additions:
The bug is fixed in Wikka 1.1.6.0

Deletions:
The bug is fixed in Wikka 1.1.6.0



Edited on 2007-12-12 12:20:28 by JavaWoman [preventing unintended wanted pages links]

Additions:
Interwiki links are broken if they are not CamelCased, like WikiPedia:Albert_Einstein will not work, but WikiPedia:CamelCase would. Wikipedia heavily relays on FreeLinks, which converts "Albert Einstein" to "Albert_Einstein". --DavidCollantes

Deletions:
Interwiki links are broken if they are not CamelCased, like WikiPedia:Albert_Einstein will not work, but WikiPedia:CamelCase would. Wikipedia heavily relays on FreeLinks, which converts "Albert Einstein" to "Albert_Einstein". --DavidCollantes



Edited on 2007-04-19 13:26:57 by BrianKoontz [Restored]

Additions:

WikiEdit : Ctrl+5 executed twice

When I type Ctrl+4 (h4), the current line is surrounded by === and ===, that's OK. But when I type Ctrl+5 (h5), What I get is ==== and ====, as if I've typed Ctrl+3. On a relatively slow computer, I saw that the WikiEdit engine added == twice. --DotMG I saw the source of the problem : Find the checkKey() prototype in file protoedit.js, and just add "k==53+2048 ||":
ProtoEdit.prototype.checkKey = function (k) {
if (k==85+4096 || k==73+4096 || k==49+2048 || k==50+2048 || k==51+2048 || k==52+2048 || k==53+2048 ||
k==76+4096 || k==76+2048 || k==78+2048 || k==79+2048 || k==66+2048 || k==83+2048 ||

--DotMG

GetCookie() bug

The GetCookie() method in wikka.php does not check whether a named cookie actually exists; this results in a NOTICE and then even partially unstyled pages; this turned up with the (beta) skins feature. (That's why I call a notice a "lurking bug". :))
Fixed already on this site; in wikka.php, change:
  1.     function GetCookie($name) { return $_COOKIE[$name]; }


to:
    function GetCookie($name)
    {
        if (isset($_COOKIE[$name]))
        {
            return $_COOKIE[$name];
        }
        else
        {
            return FALSE;
        }
    }


I've also made corresponding changes to actions/editskin.php, actions/header.php, actions/myskin.php, actions/selectskin.php and actions/skin.php in the beta versions as implemented on this server. (See also WikkaBetaFeatures.) --JavaWoman

Fatal error: Call to a member function on a non-object

moved from SuggestionBox
Received an error msg that was particularly perplexing. Since i wasn't sure where exactly to try and get help for it, i thought i'd post here tho i know it's off topic. NonObjectMemberFunction
PS if there is a better place to have posted this, i'd be happy to know what page that is.
Problems with double double-quote html?
This fix will be in the next version of Wikka; version 1.1.6.0 still has the bug.
See also NonObjectMemberFunction for the original report
Description of the problem
Wikka outputs "Fatal error: Call to a member function on a non-object in /your/full/path/to/wikka/formatters/wakka.php on line 186"
This occurs with the configuration in wikka.config.php double_doublequote_html" => "disabled and trying to view a page where double double-quotes have been used and stored.
Solution
When double_doublequote_html" => "disabled configuration is set, the current version of wikka then refers to the incorrect class when parsing ddq.
FIND in formatters/wakka.php
return $this->htmlspecialchars_ent($matches[1]);

REPLACE WITH
return $wakka->htmlspecialchars_ent($matches[1]);

This statement is never touched as long as double_doublequote_html" =>" is not set to disabled ~&Thanks; JavaWoman for your solution, thanks TimoK for trying. --MonstoBrukes ===Googleform action=== The googleform action assumes that "short open tags" can be used for PHP. But this is not the case on every installation and is actually discouraged. If they are indeed disabled (##short_open_tag = Off## in ##php.ini##), the googleform action will not work. See also http://php.net/manual/en/ini.sect.language-options.php#ini.short-open-tag. Fix: replace #### by **####** in the value attribute of the form (line 14). -- JavaWoman ''This change was included in version 1.1.6.0. -- JsnX'' ===MyChanges alphabetical sort doesn't work=== When using MyChanges action and clicking on the "order alphabetically" link the system tries to go at http://mywebsite/wikka/wikka.php?wakka=MyChanges?alphabetically=1"" and proposes to create the page. I uploaded again the MyChanges.php action from the current Wikka release (1.1.5.3) without solving anything as it was excatly the same code.
The action {{userchanges}} works perfectly.
--ChristianBarthelemy
Find this line:
        print("<strong>This is a list of pages you've edited, ordered by the time of your last change (<a href=\"".$this->href("", $tag)."?alphabetically=1\">order alphabetically</a>).</strong><br /><br />\n");   

And change it to this:
        print("<strong>This is a list of pages you've edited, ordered by the time of your last change (<a href=\"".$this->href("", $tag, "alphabetically=1")."\">order alphabetically</a>).</strong><br /><br />\n");   

This change was included in version 1.1.6.0. -- JsnX

check of user-names against page-names

This was added to Wikka in version 1.1.6.0.
New usernames should be checked against existing page names. This was prompted by a new user named 'HomePage'.
For wikka.php:
<?php
    /**
    * Check by name if a page exists.
    *
    * @author        {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
    * @copyright    Copyright © 2004, Marjolein Katsma
    * @license        http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
    * @version        1.0
    *
    * @access        public
    * @uses        Wakka::Query()
    *
    * @param        string  $page  page name to check
    * @return        boolean  TRUE if page exists, FALSE otherwise
    */

    function ExistsPage($page)
    {
        $count = 0;
        $query =     "SELECT COUNT(tag)
                    FROM "
.$this->config['table_prefix']."pages
                    WHERE tag='"
.mysql_real_escape_string($page)."'";
        if ($r = $this->Query($query))
        {
            $count = mysql_result($r,0);
            mysql_free_result($r);
        }
        return ($count > 0) ? TRUE : FALSE;
    }
?>

For actions/usersettings.php - insert after line 151:
<?php
        if ($this->ExistsPage($name))
            $error = 'Sorry, this ""WikiName"" is reserved for a page. Please choose a different name';
?>

and change if on the next line to elseif. That should do it, I think. -- JavaWoman
Feedback Action bug
The bug is fixed in Wikka 1.1.6.0
A bug was preventing the feedback action from working in installs with no rewrite rules.
original
$form = '<p>Fill in the form below to send us your comments:</p>
        <form method="post" action="'
.$this->tag.'?mail=result">
        Name: <input name="name" value="'
.$_POST["name"].' "type="text" /><br />
        Email: <input name="email" value="'
.$_POST["email"].'" type="text" /><br />
        Comments:<br />
        <textarea name="comments" rows="15" cols="45">'
.$_POST["comments"].'</textarea><br />
        <input type="submit" value="Send" />
        </form>'
;

modified
$form = '<p>Fill in the form below to send us your comments:</p>'.
        $this->FormOpen().
        '\nName: <input name="name" value="'.$_POST["name"].'" type="text" /><br />'.
        '\n<input type="hidden" name="mail" value="result">'.
        '\nEmail: <input name="email" value="'.$_POST["email"].'" type="text" /><br />'.
        '\nComments:<br />\n<textarea name="comments" rows="15" cols="40">'.$_POST["comments"].'</textarea><br / >'.
        '\n<input type="submit" value="Send"/>'.
        $this->FormClose();

original
if ($_GET["mail"]=="result") {

modified
if ($_POST["mail"]=="result") {

-- DarTar, 08 Dec 04
Unicode rendering buglet
See my latest edit in the Sandbox labeled [Unicode bug?] - someone was trying to create a link in Unicode, and I tried a bit more: Unicode characters (Chinese, Korean) are rendered just fine when they occur in plain text; but in a forced link when they occur in the link text they are escaped.
(Just in case the (Korean) example disappears:
Hmmm - 안되려나 - Unicode rendered in plain text but not for link text (안되려나)? Looks like a bug to me.)
Same problem in comments. (See also SandBox.)
--JavaWoman
Link text was being passed through htmlspecialchars in $wakka->Link to prevent HTML from being inserted into pages through forced links. However, PHP's builtin htmlspecialchars function messes up Unicode.
I've added a custom function to Wikka which performs the same task as htmlspecialchars, but will leave Unicode untouched.
    function htmlspecialchars_unicode($text="")
    {
        $text = preg_replace('/&(?!#[0-9]+;)/s', '&', $text);
        $text = str_replace('<', '<', $text);
        $text = str_replace('>', '>', $text);
        $text = str_replace('"', '"', $text);
        return $text;
    }

-- JsnX
A somewhat different solution was implemented in Wikka 1.1.6.0.
See latest comments on the SandBox page. there was a bit of text with [[]] embedded in the middle of a word; somehow the formatter dropped a lot of source right after that bit (chopping off in the middle of that word) , seemingly picking up only at the next forced link (???) - anyway, a whole lot of content didn't appear at all and there were unclosed tags as well, causing HTML-rendering problems.
Fixed the SandBox page content (for) now, but we should look at what the Formatter does with an "empty forced link" - my guess is it expects (via RE) some content after [[ and only sees a ]] much later as the closing of the forced link. (I haven't looked at the Formatter code yet.)
... later ...
I think I found it. Near the end of formatters/wikka.php we have a preg_replace_callback() call, with a whole range of REs to recognize the things to be acted on. It contains this line (part of the full RE) to match a forced link:
    "\[\[[^\[].*?\]\]|".

this does indeed expect at least one (not-[) character after the opening two [[; I think this could be replaced with:
    "\[\[[^\[]*?\]\]|"

which would also match an empty set of [[]]. Looking at the portion that actually handles forced links, it looks to me an empty set of [[]] would simply not match the more prcise RE for a forced link there, and thus result in an empty string.
Please test, but I think this would fix it.
--JavaWoman

WikiEdit UTF-8 Bug

I'm actually not sure if this is a Wikka Bug or not, but I'll put it out there. If the Character Set encoding in Internet Explorer 6 is set to Unicode (UTF-8) the Wikiedit Toolbar does not display and a JavaScript Runtime Error occurs on the page. (You have to doubleclick the little yellow exclamation point icon in the bottom left corner to see the actual error message.) If you right click in the page, select encoding, and change the encoding to Western European (ISO), then the Wikiedit Toolbar appears. If I configure the Default CharSet to be iso-8859-1 in my httpd.conf file, then everything works fine. If I set the default charset to be UTF-8, then I get the error. Is this normal behavior with UTF-8 encoding? -- RichardTerry
I think I've fixed this, have a look at http://www.euroburners.org/wikka/wikiedit2/wikiedit2.js I've removed some comments that had non UTF-8 chars in them. --DaveBradshaw

Strikethrough rendering

Strikethrough seems to highlight the selected text like this instead of striking through it. Looks like Wikka uses the deletions class from wikka.css instead of the strikethrough class.
.strikethrough {color: #888; text-decoration: line-through;}
.deletions {color: #876; background-color: #FFCC99;}

--RichardTerry
(see new code below)
--NilsLindenberg (no own computer, no installed wikka :( change in formaters/wakka.php
static $trigger_inserted = 0;
static $trigger_center = 0;

to
static $trigger_inserted = 0;
static $trigger_deleted = 0;
static $trigger_center = 0;

and
$trigger_bold = $trigger_center = $trigger_floatl = $trigger_inserted = $trigger_italic =$trigger_keys = 0;

to
$trigger_bold = $trigger_center = $trigger_floatl = $trigger_inserted = $trigger_deleted = $trigger_italic =$trigger_keys = 0;

and
// strikethrough
else if ($thing == "++" || $thing == "¥¥") 
{
 return (++$trigger_strike % 2 ? "<span class=\"deletions\">" : "</span>");
} 

to
// strikethrough
else if ($thing == "++") 
{
return (++$trigger_strike % 2 ? "<span class=\"strikethrough\">" : "</span>");
} 

and add (after //inserted))
// deletions
else if ($thing == "¥¥") 
{
return (++$trigger_deleted % 2 ? "<span class=\"deletions\">" : "</span>");
} 

Entering { on French keyboard

When I want to write { with my keyboard, the javascript is supposing I was typing Ctrl+Shift+4, so it encloses the actual line by ===. The same ennoying happens for ~, # and [. [DotMG] Added your suggestion in Wikka 1.1.5.4. Thanks for pointing this out. -- JsnX

Underline in headers

In the CategoryUsers, there is a header (Wikka User locations:) which is also underlined. But the underlinig does not stop ad the end of the header but goes on for the whole page. -- NilsLindenberg
(This is in UserMap now --JW)
array_merge
Array_merge seems to work different in php5, which leeds to the following error:
array_merge() [function.array-merge]: Argument #2 is not an array in [Wikipath]\wikka.php on line 910
As a comment on http://www.php.net/manual/en/function.array-merge.php points out (01-Nov-2003 01:08 ):
In all PHP 4 versions the above function deals gracefully with paramaters which are NOT arrays(). So if you pass a string or number it will be automagically converted to an one-element array as described in the manual section about Types and "implicit typecasting". So if you ever happen to put an empty/unset variable (NULL value) as parameter, array_merge() will still collapse the other arrays as intended.
PHP4 does not carry if both strings are arrays, but php5 seem to do ("From PHP5beta2 on this behaviour changed, and PHP will correctly issue a E_WARNING message, whenever one of the paramters isn't an array.")
the following change in wikka.php was successfull:
if (file_exists("wakka.config.php"))
{
rename("wakka.config.php", "wikka.config.php");
} else {
$wakkaConfig = array();
} 

Interwiki is broken

Interwiki links are broken if they are not CamelCased, like WikiPedia:Albert_Einstein will not work, but WikiPedia:CamelCase would. Wikipedia heavily relays on FreeLinks, which converts "Albert Einstein" to "Albert_Einstein". --DavidCollantes 1. wikka.php -- Link() method - change near the start as follows:
<?php
        // is this an interwiki link?
        if (preg_match("/^([A-Z,ÄÖÜ][A-Z,a-z,ÄÖÜ,ßäöü]+)[:](\S*)$/", $tag, $matches))
        {
            $url = $this->GetInterWikiUrl($matches[1], $matches[2]);
        }
        // is this a wiki link?
        elseif (preg_match("/^[A-Za-z0-9]+$/", $tag))
        {
            if ($_SESSION["linktracking"] && $track) $this->TrackLinkTo($tag);
            $linkedPage = $this->LoadPage($tag);
            // return ($linkedPage ? "<a href=\"".$this->Href($method, $linkedPage['tag'])."\">".$text."</a>" : "<span class=\"missingpage\">".$text."</span><a href=\"".$this->Href("edit", $tag)."\" title=\"Create this page\">?</a>");
            return ($linkedPage ? "<a href=\"".$this->Href($method, $linkedPage['tag'])."\" title=\"$title\">".$text."</a>" : "<a href=\"".$this->Href("edit", $tag)."\" title=\"Create this page\"><span class=\"missingpage\">".$text."</span></a>");
        }
        elseif (preg_match("/^(http|https|ftp):\/\/([^\\s\"<>]+)$/", $tag))
        {
            $url = $tag; // this is a vaild external URL
        }
        // is this a full lin