It should be simple. My example-code:
{{#arraydefine:test|-1,-2,1,2,3|,}}
{{#arrayprint:test|<br/>|@@@@|Test: @@@@}}
Returns:
Test: -Array
Test: -Array
Test: Array
Test: Array
Test: Array
Why?
See my example.
It should be simple. My example-code:
{{#arraydefine:test|-1,-2,1,2,3|,}}
{{#arrayprint:test|<br/>|@@@@|Test: @@@@}}
Returns:
Test: -Array
Test: -Array
Test: Array
Test: Array
Test: Array
Why?
See my example.
Ah! There's a bug:
Notice: Array to string conversion in PATH/htdocs/mediawiki-1.34.1/extensions/Arrays/ExtArrays.php on line 1220 Notice: Array to string conversion in PATH/htdocs/mediawiki-1.34.1/extensions/Arrays/ExtArrays.php on line 1220
Can you file an issue for this on Phabricator? If this is something that will affect any 1.34 wiki trying to use Ext:Arrays, it needs to be resolved.
Thanks for pointing this out: https://phabricator.wikimedia.org/T245134
I solved this by setting legacy mode.
Ran into this myself. "Array blah blah blah" instead of the expected "1 blah blah blah" as output. Now, trying to figure out what the mentioned legacy mode is...
Extension:Arrays#Configuration
Add `$egArraysCompatibilityMode = true` to local settings. This will change other things, though. I wanted to point to the old docs, via diff link, but the abuse filter says it's harmful.
The old docs in question are at Special:Diff/2888061#Differences compared to Arrays 2.0.
I ended up using a rather clunky workaround, but it works, without the negatives of compatability mode. Only negative is that when you sort the array, 1, 2, and 3 will sort at the end, rather than the beginning.
In my case, {{{Bar}}} is a CSV string that I turn into an array.
{{#arraydefine:Foo|{{#replace:{{#replace:{{#replace:{{{Bar}}}|1|①}}|2|②}}|3|③}} }}
Then later:
{{#arrayprint:Foo|
|@@@@ |{{#vardefine:val|{{#replace:{{#replace:{{#replace:@@@@|①|1}}|②|2}}|③|3}} }} ... }}
Just an update that 0 is also affected, though 4 through 9 are ok to leave 'unprotected'.