Last modified: 2012-03-01 20:47:16 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 T35420, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33420 - Validator extension: A new "page" type.
Validator extension: A new "page" type.
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Validator (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Jeroen De Dauw
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-29 22:01 UTC by Van de Bugger
Modified: 2012-03-01 20:47 UTC (History)
3 users (show)

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


Attachments
Implementation of the type. (2.82 KB, patch)
2011-12-29 22:02 UTC, Van de Bugger
Details

Description Van de Bugger 2011-12-29 22:01:08 UTC
A new type: `page'.
Comment 1 Van de Bugger 2011-12-29 22:02:02 UTC
Created attachment 9780 [details]
Implementation of the type.
Comment 2 Sumana Harihareswara 2012-02-14 12:39:48 UTC
Adding Jeroen to cc list since he maintains the Validator extension.
Comment 3 Jeroen De Dauw 2012-02-14 14:17:26 UTC
AFAIK this has already been applied by Van himself.
Comment 4 Van de Bugger 2012-02-14 17:09:28 UTC
> AFAIK this has already been applied by Van himself.

No. It was not me. Daniel Werner added something very similar, but named it "Title", not "Page". I do not care about this change, but:

Why new type name is capitalized? Other type names are of lower case: `string', `float', `boolean', but this one is `Title'. I want it in lowercase, like other types, because these values are user-visible in my another extension.
Comment 5 Jeroen De Dauw 2012-02-14 17:21:20 UTC
> It was not me. Daniel Werner added something very similar

Oops, sorry. I got confused there :)

> Why new type name is capitalized?

It should not be. I will fix this in a moment.

> in my another extension.

Which one?

So if the capitalization issue is fixed, does the title addition help you out or not? If not, please create a new patch that includes the new Criterion and Manipulation classes which you apparently forgot to add.
Comment 6 Van de Bugger 2012-02-14 19:38:41 UTC
> Which one?

It is not yet published. I once mentioned it -- a parser function which provides templates with Validator functionality. For example:

> {{  #validate: 
>     |   target  = type: page;   alias: 1;
>     |   text    = type: string; alias: 2;  default: {{ PAGENAME:     {{{ target }}} }};
>     |   tooltip = type: string; alias: 3;  default: {{ FULLPAGENAME: {{{ target }}} }};
>     |   link?   = type: boolean;           default: yes;
> }}

After it, in template body {{{ target }}}, {{{ text }}}, {{{ tooltip }}}, {{{ link? }}} are ready to use.

Before it was bloacked because it required patched Validator (it uses page type), now I have to fix it a bit -- replace `page' with `title'.

And I am not settled down with names yet...

> So if the capitalization issue is fixed, does the title addition help you out
> or not? If not, please create a new patch that includes the new Criterion and
> Manipulation classes which you apparently forgot to add.

`Title' type is the almost the same as my `Page' type, only names are differ. I think I can use it. If capitalization is fixed, I believe I can use it.
Comment 7 Van de Bugger 2012-02-26 22:20:30 UTC
Ping. Please convert `Title' type name to lower case.
Comment 8 Jeroen De Dauw 2012-02-26 23:08:02 UTC
r112454

Can this be closed, or do you still need me to do something?
Comment 9 Van de Bugger 2012-02-27 20:12:03 UTC
Let me check it with my code.
Comment 10 Van de Bugger 2012-02-27 21:55:03 UTC
Ok, this works for me.
Comment 11 Daniel A. R. Werner 2012-02-28 21:53:49 UTC
The only reason I originally used a capital letter on this was that in PHP basic primitive types such as bool, int or string use lower-case while for object-types we usually use upper case.
Comment 12 Jeroen De Dauw 2012-02-28 22:04:17 UTC
I figured as much. Still, these values are not meant to reflect whatever the name of the corresponding type in PHP is.

Although I'd go for keeping it all lower case, I'm wondering what the difference is. Van, are you comparing to the string value for some reason? You should use the constants...
Comment 13 Van de Bugger 2012-02-29 17:50:00 UTC
As I said, I wrote a "front-end" for Validator to use in templates. So, I have to have string representation for all the types. I decided not to introduce more entities but use values of TYPE_xxx constants. So, title type is represented in PHP code as TYPE_TITLE, and as "title" in template. See example above.
Comment 14 Van de Bugger 2012-03-01 20:47:16 UTC
Verified on r112454.

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


Navigation
Links