Re: [Wikitech-l] URL parameter fetching (mediawiki)

2019-10-31 Thread majorjohn1
Thank you for this. I have tried setting my own custom key-value pair (e.g. 
using $this->getRequest()->setVal( 'reasonConfirm', 1 );), but I cannot 
seem to retrieve it when the page reloads. I've tried both getVal (returns null 
every time) and getInt (always returns '0') to no avail. Is there a special way 
to set your own custom variables?

Interestingly, I have also noticed that my return $this-msg() text is no longer 
displaying at all. When my validation callback is triggered, only the top 
"There are problems with some of your input." appears. I have checked en.json 
and can confirm that the message that should be displayed is still present and 
is properly formatted.

-TheSandDoctor

-Original Message-
From: Wikitech-l  On Behalf Of bawolff
Sent: October 1, 2019 1:12 PM
To: Wikimedia developers 
Subject: Re: [Wikitech-l] URL parameter fetching (mediawiki)

MediaWiki coding conventions is to use the WebRequest object.

In the context of a SpecialPage subclass, you would probably do
$this->getRequest()->getVal( 'reason' );   [Note: This combines both POST
and GET values]

See
https://doc.wikimedia.org/mediawiki-core/master/php/classWebRequest.html#a3eecdf9b5d20122630bf5cc9c8506084
for more details.

--
Brian

On Tue, Oct 1, 2019 at 7:51 PM John Shepherd  wrote:

> Is there a “special” way in mediawiki to get parameters passed by URL 
> or do you just use the conventional PHP way ($_GET)? I am trying to 
> check if “Special:CreateAccount?reason=“ is set/has a value (and what that 
> value is).
>
> Thank you for your assistance, trying to be convention compliant.
> -TheSandDoctor
>
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] URL parameter fetching (mediawiki)

2019-10-01 Thread bawolff
MediaWiki coding conventions is to use the WebRequest object.

In the context of a SpecialPage subclass, you would probably do
$this->getRequest()->getVal( 'reason' );   [Note: This combines both POST
and GET values]

See
https://doc.wikimedia.org/mediawiki-core/master/php/classWebRequest.html#a3eecdf9b5d20122630bf5cc9c8506084
for more details.

--
Brian

On Tue, Oct 1, 2019 at 7:51 PM John Shepherd  wrote:

> Is there a “special” way in mediawiki to get parameters passed by URL or
> do you just use the conventional PHP way ($_GET)? I am trying to check if
> “Special:CreateAccount?reason=“ is set/has a value (and what that value is).
>
> Thank you for your assistance, trying to be convention compliant.
> -TheSandDoctor
>
> ___
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

[Wikitech-l] URL parameter fetching (mediawiki)

2019-10-01 Thread John Shepherd
Is there a “special” way in mediawiki to get parameters passed by URL or do you 
just use the conventional PHP way ($_GET)? I am trying to check if 
“Special:CreateAccount?reason=“ is set/has a value (and what that value is).

Thank you for your assistance, trying to be convention compliant.
-TheSandDoctor

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l