Wiclear

You are here :

 Bugs

Friday, 21. April 2006 13:22:33, by anonymous anonymous

 

Feel free to enter here the bugs you just found.


Diff algorithm

Very simple, needs a lot of improvement as it is far from only showing minimal differences.


I setup Wiclear using MySql 5.0 and the history page failed to display full history (just listed current page). I tracked it down to the SQL query in wiki.class.php

(...snip)

function getHistory($content_id)
 {
   $content_id = $this->con->escapeString($content_id);
   $query = <<<SQL
     SELECT wc_history.id, wc_history.title, wc_history.alternate_title, wc_history.content,  wc_history.commit_msg, wc_history.minor_major, wc_history.ip, wc_history.timestamp,
            wc_lang.id, wc_lang.code, wc_lang.description, wc_lang.flag,
            wc_content_hierarchy.parent_content_fk,
            wc_content_lang.related_content_fk,
            wc_user.id, wc_user.login, wc_user.firstname, wc_user.lastname, wc_user.email
     FROM   wc_history
     JOIN   wc_content on wc_content.id=wc_history.content_fk
     JOIN   wc_lang on wc_lang.id=wc_content.lang_fk
     JOIN   wc_user on wc_user.id=wc_history.user_fk      
     JOIN   wc_content_hierarchy on wc_content_hierarchy.content_fk=wc_content_lang.related_content_fk
     JOIN   wc_content_lang on wc_content_lang.content_fk=wc_history.content_fk
           WHERE  wc_history.content_fk='$content_id'
     ORDER BY wc_history.timestamp DESC;
SQL;

(snip...)

This sql returned the error

Unknown column 'wc_content_lang.related_content_fk' in 'on clause'

To fix it I swap these two lines

      JOIN   wc_content_hierarchy on wc_content_hierarchy.content_fk=wc_content_lang.related_content_fk
     JOIN   wc_content_lang on wc_content_lang.content_fk=wc_history.content_fk

To

   JOIN   wc_content_lang on wc_content_lang.content_fk=wc_history.content_fk
   JOIN   wc_content_hierarchy on wc_content_hierarchy.content_fk=wc_content_lang.related_content_fk
   

MySql 5 now seems to join tables in order and you cannot reference a table that has not yet be joined.

The same needs to be done to


Version 0.9.tgz download

This also seems to be in the download for 0.9-beta3.tgz


Excellent program by the way. It is fast and easy to use, it works the way I expect it too (and I've used a few that don't). Thanks for all your time and effort.