Difference between revisions of "WikiDB/Roadmap"

From TestWiki
Jump to: navigation, search
(Bugs)
(BUG: data tag does not create new table entry when using ExpandAfter MW extension)
Line 78: Line 78:
  
 
Thanks! -- [[User:Mdrayman|Mdrayman]] 20:02, 5 July 2007 (BST)
 
Thanks! -- [[User:Mdrayman|Mdrayman]] 20:02, 5 July 2007 (BST)
 +
 +
=== BUG: Using Repeat tag on a Table where the filter results in Zero results yields ERROR ===
 +
 +
I have been making heavy use of WikiDB in the past couple of weeks and I found that with any WikiDB table that not even need be empty, when using the <nowiki><repeat></nowiki> tag to filter the table's contents for a particular value of one of the fields, WikiDB reports some bad errors when there are ZERO results returned from the use of the filtering via the <nowiki><repeat></nowiki> tag.
 +
 +
[[Image:WikiDB_Repeat_Filter_Zero_Result_Error.png|right|300px]]
 +
At the right is a screenshot of my Firefox browser window in the wiki page using the <nowiki><repeat></nowiki> tag to filter contents of the table when the filter returns zero results.  If I then change a single table entry on another wiki page where it is defined to then make the filter results non-zero, these errors go away completely.
 +
 +
Any idea what's going on here?  Let me know if you have any questions about what I'm trying to do.
 +
 +
-- [[User:Mdrayman|Mdrayman]] 21:27, 5 July 2007 (BST)
  
 
== Administration ==
 
== Administration ==

Revision as of 20:27, 5 July 2007

This is an (incomplete) list of features and bugs that need fixing for v1.

Bugs

  • On table display, the definition is currently above the page title and sitenotice. This only seemed to happen since I set 'MediaWiki:Sitenotice', so maybe has something to do with that - or maybe I just never noticed it for some reason? --HappyDog 00:00, 6 January 2007 (GMT)
    • It was to do with the site notice. ParserBeforeStrip is being called once for each interface message that uses wiki text (I assume - it's being called for that one, anyway!). I now use a flag so that the code in my hook only executes the first time it is called for a page. This will only work if (a) the hook is called for every page view (i.e. it is not avoided by caching) and (b) it is always called first. I don't know the answer to either of these, so if the bug resurfaces please let me know! --HappyDog 03:30, 23 January 2007 (GMT)
  • If a table doesn't have a definition, the 'data' tab is not displayed in 1.6.8 (it's ok in 1.5.6). --HappyDog 03:33, 23 January 2007 (GMT)
    • FIXED - In 1.5.6 the first tab is always 'nstab-main' - at some point this changed to include the namespace (e.g. nstab-table). Now I just check the first 6 characters equal "nstab-".
  • If I use a <repeat>-tag in a template and then use a template-parameter in the criteria-clause, then the parameter-value in the criteria-clause is not replaced by its value first. (Stephanvaningen, 23 May 2007)
  • Like this: <repeat table="handelaars" criteria="id={{{templateparametername}}}">{{{tablefield}}}</repeat>
  • After that, I tried this:
    • <repeat table="handelaars" criteria="id=50">{{template}}</repeat>, with in the template then direct use of the field names from the table. This seems not to work
    • This I tried because I wanted to prevent writing *all* the table fields each time when calling the template: are there any possibilities there?
      • Hey, I actually got this to work. I was able to use the <repeat> tag inside a Template using template parameters to feed the fields of the <repeat> tag using a MediaWiki Extension called ExpandAfter. Follow the link to learn how to install it. Once installed, use it like this in your template: {{#expandafter|repeat|table="handelaars" criteria="id={{{templateparametername}}}">{{{tablefield}}} }} What this extension does is parse out the template parameters BEFORE calling the WikiDB code for the <repeat> tag. What's really cool about this ExpandAfter extension is that it works for ANY <xxx> tag in MediaWiki, not just the <repeat> or <data> tags for WikiDB, but for others too, such as any tags introduced by other extensions. -- Mdrayman 04:35, 3 July 2007 (BST)

BUG: data tag still creates records inside of nowiki tags

If I put the following code in a wiki page, the table referenced in the <data> tag still makes a record show up in that table. Is there any way to illustrate to a user in a wiki page how to use the <data> tag without it adding records to the real table?

<data table="ServiceCustomerJobs">
job_num=
account_num=
description=
date_called=
date_serviced=
completion_time=
job_page=
satisfaction=
complaint_page=
</data>

I bet that if you go look at the Special:UndefinedTables special page, there will be a new table called "ServiceCustomerJobs" because the <nowiki> tags didn't prevent WikiDB from using the <data> tag as a new record declaration.

-- Mdrayman 04:35, 3 July 2007 (BST)

I just checked the Special:UndefinedTables on this wiki and sure enough, even though I used the <nowiki> tags, the table still showed up with the record defined above.

Any clues as to what's going on here?

-- Mdrayman 04:37, 3 July 2007 (BST)

Hmmm... well I'm not sure if there's anything I can do about that, but I will check. I may be doing something funky like manually parsing the page - in which case this is definitely something that needs fixing. If not, then it is a problem in MediaWiki itself. I suspect the former, however, and will look into it. In the meantime, an easy workaround is to use &gt; instead of > and &lt; instead of < when creating your example data tags. --HappyDog 13:28, 4 July 2007 (BST)
Thanks. I'll use those special codes in the meantime. Good luck figuring out what's really going on. -- Mdrayman 20:02, 5 July 2007 (BST)

BUG: data tag does not create new table entry when using ExpandAfter MW extension

I mentioned above about using the ExpandAfter MediaWiki extension to populate fields of the <repeat> tag inside of a template. Now, this extension works with the <repeat> tag, however, it does not work quite right with the <data> tag. Below are two attempts to add a table entry to a new table called ExpandAfterTable.

Not using ExpandAfter:


<data table="ExpandAfterTable" template="default">
value1=nothing
value2=something
value3=everything
</data>

Using ExpandAfter:


{{#expandafter:data|table="ExpandAfterTable" template="default"|
value1=nothing
value2=something
value3=everything
}}

Now, what happens when I use the <data> tag by itself in the above manner, the new table entry shows up in the Table:ExpandAfterTable page and in the page it was added shows the normal table printout of the single entry.

When I use the ExpandAfter extension to do the same thing, which, by the way, does work for the <repeat> tag, the table printout appears on the page containing the <data> tag instance, however, the Table:ExpandAfterTable page does not show a record for this entry.

My question is, given that the ExpandAfter extension works correctly to recreate the wiki text shown in the first example above AND WikiDB does print out the table entry in the page it was entered, why then does WikiDB not add this table entry to the table itself?

You may need to install the ExpandAfter extension to test this out. When you do, you'll see what I mean, and, I think you'll like using this extension since it will allow you to use the WikiDB tags inside of templates and pass template parameters to the WikiDB tags inside of those templates.

Thanks! -- Mdrayman 20:02, 5 July 2007 (BST)

BUG: Using Repeat tag on a Table where the filter results in Zero results yields ERROR

I have been making heavy use of WikiDB in the past couple of weeks and I found that with any WikiDB table that not even need be empty, when using the <repeat> tag to filter the table's contents for a particular value of one of the fields, WikiDB reports some bad errors when there are ZERO results returned from the use of the filtering via the <repeat> tag.

At the right is a screenshot of my Firefox browser window in the wiki page using the <repeat> tag to filter contents of the table when the filter returns zero results. If I then change a single table entry on another wiki page where it is defined to then make the filter results non-zero, these errors go away completely.

Any idea what's going on here? Let me know if you have any questions about what I'm trying to do.

-- Mdrayman 21:27, 5 July 2007 (BST)

Administration

  • Update tables when page is moved.
  • Update tables when page is deleted.
  • Update tables when page is undeleted.
  • (check that rollbacks work)
  • 'What links here' should show templates that are included via data tags.

Syntax

  • Better data syntax: Need to allow multiple rows in a single definition.
    • Also, data definitions in a DB namespace shouldn't require the 'table' attribute (default to current).
  • Repeat tag - some things to iron out (see below)
  • Field names need to be limited to 255 chars (DB limit)
  • Field names need to have leading underscores removed (Reserved for special uses)
  • Provide a mechanism for 'pass-through' parameters to the <data> tag (i.e. parameters that are supplied to the template, but which don't get added to the table). Suggestion is to prefix the name with an exclamation mark. Alternatively, an underscore could be used, as this is already reserved in table definitions, and therefore is not allowed in data tags (though this is not enforced) - may kill two birds with one stone...

Repeat tag

Still quite a way to go on this, but here's where I'm up to:

Done

  • Basic sort/filter is implemented. Only limited filter options available, due to a parsing issue with MW/HTML.
  • Contents of repeat tag are repeated for each row with variables expanded (see below for limitations).

To Do

  • Tag Contents
    • Aliases are currently expanding correctly, but not in a foolproof manner (e.g. aliases that point to aliases are not handled - this is a general issue, I think)
    • Undefined fields - is their current handling OK? Currently they will be expanded if defined for the row, and left as they are if not. This might be the best behaviour, but perhaps not.
    • Cannot currently supply default values for empty fields. In any case (given the above point) default values for undefined fields must, by definition, be ignored (I think).
    • Cannot handle nested vars. Not a problem at the moment, but if default values are allowed, the default should be allowed to be an alternative variable (e.g. {{{ShortName}}} should be valid syntax).
    • Should strip blank lines at start and end. Maybe restrict to stripping 1 line only (so <repeat> need not be on the same line as the start of it's content). Should _not_ use trim(), as we need to allow for space at start of line (wiki <pre> syntax).
  • Filtering
    • Can't use > in attribute values, e.g. criteria="Field>Value", as it cripples parser. Need to decide how to specify criteria.
    • In general - how detailed can we get?
  • Other
    • Ability to have header/footer? Ideally you put your header before the repeat tag, and the footer afterwards, but tables are screwed up by this (though I might be able to fix that somehow). There may also be other situations that cause problems.

Code Tidying

  • Ensure all user-visible text uses the message cache.
  • Add profiling statements.
  • Move datatype handlers out of WikiDB class (into separate module).

Misc

  • References to tables in table="..." attributes should follow redirects. This allows tables to be moved without screwing everything up!
  • Special:UnusedTables to list tables that don't have any data (opposite of Special:UndefinedTables).