Extension talk:Data

Indexes
What indexing should be used on the data_extension table. John Stanton 19:47, 4 November 2006 (UTC)


 * I think at least item and key columns should be indexed. Nikola 02:28, 16 November 2006 (UTC)

Code
It seems that the following is needed to avoid PHP warnings:

$wgHooks['LanguageGetMagic'][] = 'wfDataLanguageGetMagic';

function wfDataLanguageGetMagic( &$magicWords, $langCode ) { switch ( $langCode ) { default: $magicWords['data']         = array( 0, 'data' ); $magicWords['sort']         = array( 0, 'sort' ); }   return true; }

Patrick 11:36, 5 February 2007 (UTC)

Added default handling
Hi!

I just want to inform you that I have added the handling of defaults to the get function, so that one can use constructs like

which will output "default" if key is not set. I have made it such, that it looks like parameter references in templates

I noticed that I needed this functionality pretty often, and that it can replace the somewhat lengthy

If you want to include this functionality into the extension, just go ahead. Here is the modified "get" function:

Cheers --141.2.138.89 16:27, 6 November 2007 (UTC) (de:Benutzer:olenz)

PHP failing
Just downloaded the code from the 3 Feb update. I get the following error (twice) when I load any wiki page Warning: array_slice [function.array-slice]: The first argument should be an array in /var/www/wikijfh/languages/Language.php on line 1153 Noted that an extra piece of code (function wfDataLanguageGetMagic) is recommended and included in the latest version, except for the line $wgHooks['LanguageGetMagic'][] = 'wfDataLanguageGetMagic'; I get the error with and without this extra line. I have created the required table in wikidb. My LocalSettings includes the following lines include("extensions/Expr.php"); include("extensions/ParserFunctions.php"); include("extensions/Data.php"); Ideas ???


 * The line is there, fourth line of code in wfDataExtension function. But something weird is going on. Try moving data extension to the top of your list of extensions (including it before any other extension), see if that works. Alternarively, you could add a @ at the beginning of the line 1153 in languages/Language.php . Nikola Smolenski 09:32, 9 February 2008 (UTC)