Extension:DataTable2/History

Old versions
Release numbers lower than 0.8 refer to the old DataTable extension.

Version 0.8
A number of breaking changes has been introduced which in some circumstances require more work from wiki editors, but which should make the behaviour of the extension (and the php code) easier to understand and align it better with the way most extensions work.

Since a it might take some time to migrate from the old to the new version, the new version has been named DataTable2 (with a tag &lt;datatable2&gt; and all other tags and parser function names prefixed with dt2-) so that it can co-exist with the old version in the same wiki installation.

Configuration changes
All configuration parameters are new.

Changes to the data model
Data is stored in the table datatable2_data much the same way as it was before in datatable_data. Columns can now be given names, which are stored in the table datatable2_meta.

Since the column dtd_page does not have a NOT NULL constraint any more, you can use the table to make data from sources other than wikipages available within your wiki. To do that, you can either insert other data in the table with any means you like, or create a view as a union of the table with some other table(s) and set the configuration parameter $wgDataTable2Read to the name of that view.

Once you have finished migration of your wiki from DataTable to DataTable2, don't forget to drop the old table datatable_data.

Changes to the &lt;datatable2&gt; tag

 * Attributes are not subject to template replacement any more. This is because the attributes fs and rs are needed in the save triggers, where no frame information is available, and in general it is not common in extensions to apply replacement to tag arguments.
 * An empty &lt;head&gt; tag caused the content to be rendered within a wiki table. Empty &lt;head&gt; tags are now ignored; to force a wrapping table, you need to do one of the following:
 * Supply an nonempty &lt;head&gt;</tt> tag.
 * Supply a nonempty class</tt> attribute.
 * Do neither supply a template</tt> attribute nor a &lt;template&gt;</tt> tag.
 * The contents of &lt;head&gt; used to be wrapped between |- items so that they worked even when the user forgot some wiki table markup. This is not the case any more, hence it is now the user's responsibility to write correct wikitext.
 * The attributes p1, p2, p3, p4</tt> are not supported any more. Instead, there is a new attribute args</tt> which is copied verbatim to the template invocation for each row.
 * When no template was defined (neither as a template</tt> attribute nor as a &lt;template&gt;</tt> tag), the data used to be rendered using default field and record separators. Now, the data is rendered in a wiki table.
 * In the data, pipe characters within templates or links were interpreted as pipe characters rather than field separators. This implied a rather complex and probably error-prone parsing algorithm which has been abandoned in favor of a simple split by pipe. Hence, you need to replace pipe characters within templates or links with the template  | </tt>, or use a different field separator.

Bugfixes
The WHERE and ORDER BY clauses are now sanitized to protect against SQL injection.

New features
Many arguments to &lt;datatable2&gt; as well as all means to retrieve data are new.

Other changes
The code has been reviewed in order to comply better with the guidelines on mediawiki.org.