Last modified: 2013-07-23 21:13:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53063, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51063 - "pages" property does not allow for integers and arrays of integers
"pages" property does not allow for integers and arrays of integers
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
BookManagerv2 (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Molly White
:
Depends on:
Blocks: 50958
  Show dependency treegraph
 
Reported: 2013-07-09 19:20 UTC by Molly White
Modified: 2013-07-23 21:13 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Molly White 2013-07-09 19:20:42 UTC
The code that I took from EventLogging only allows arrays to contain one type of value. The "pages" property should allow for something like the following:

[2, [5,8]]

This would indicate that the section included pages 2, 5, 6, 7, 8. 

Right now the validation either allows only numbers, which would require the JSON to be formatted:

[2, 5, 6, 7, 8]

or only arrays, which would require the JSON to be formatted:

[[2], [5,8]]

Both of these seem a little silly, so it seems like it would be worth adjusting the code to allow for more than one type of value, and, ideally, pushing the changes back to EventLogging as well.
Comment 1 Ori Livneh 2013-07-11 09:34:25 UTC
I'm not able to reproduce this; can you provide some additional details?

Here's what I tried:

    $schema = array( 'properties' => array(
        'collection' => array(
            'type' => 'array',
        ),
    ) );

    $obj = array( 'collection' => array( 8, "hello", array(6) ) );
    var_dump ( efSchemaValidate( $obj, $schema ) ); // output:
bool(true)
Comment 2 Molly White 2013-07-11 09:47:08 UTC
Sure. The schema that I am using is https://meta.wikimedia.org/wiki/Schema:BookManagerv2. The relevant bits are lines 179–199. Is this the incorrect way to indicate that an array should contain numbers or arrays of numbers?

In your example, why is the string passing the validation?
Comment 3 Molly White 2013-07-23 20:19:03 UTC
The "Refactoring of Proofread Page extension" is working on a system to populate book pages with the <pages index> tags, and so we are stepping back from that feature. The "pages" property will be removed from the schema entirely.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links