Page MenuHomePhabricator

Remove unnecessary hidden field from HTMLForm Object
Closed, ResolvedPublic

Description

In HTMLForm there are already hidden field declared, so remove the unnecessary hidden field from HTMLForm Object

'get' Method

  • Declaration in HTMLForm:-
$html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";
  • Problem

Actual url:- /index.php?limit=20&title=Special%3AListSignupDisplay
Expected url:- /index.php/Special:ListSignupDisplay?limit=20

In 'post' Method

Declaration in HTMLForm:-

$html .= Html::hidden(
	'wpEditToken',
	$this->getUser()->getEditToken( $this->mTokenSalt ),
	[ 'id' => 'wpEditToken' ]
	) . "\n";
$html .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n";

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 473059 had a related patch set uploaded (by Jayprakash12345; owner: Jayprakash12345):
[mediawiki/extensions/WhoIsWatching@master] Remove unnecessary hidden field from HTMLForm

https://gerrit.wikimedia.org/r/473059

Change 473064 had a related patch set uploaded (by Jayprakash12345; owner: Jayprakash12345):
[mediawiki/extensions/ListSignup@master] Remove unnecessary hidden field from HTMLForm

https://gerrit.wikimedia.org/r/473064

Change 473065 had a related patch set uploaded (by Jayprakash12345; owner: Jayprakash12345):
[mediawiki/extensions/ConfirmAccount@master] Remove unnecessary hidden field from HTMLForm

https://gerrit.wikimedia.org/r/473065

Change 473066 had a related patch set uploaded (by Jayprakash12345; owner: Jayprakash12345):
[mediawiki/extensions/EditUser@master] Remove unnecessary hidden field from HTMLForm

https://gerrit.wikimedia.org/r/473066

Change 473059 merged by jenkins-bot:
[mediawiki/extensions/WhoIsWatching@master] Remove unnecessary hidden field from HTMLForm

https://gerrit.wikimedia.org/r/473059

Change 473064 merged by jenkins-bot:
[mediawiki/extensions/ListSignup@master] Remove unnecessary global, hidden field and setAction from HTMLForm

https://gerrit.wikimedia.org/r/473064

Change 487653 had a related patch set uploaded (by Jayprakash12345; owner: Jayprakash12345):
[mediawiki/extensions/IndexFunction@master] Remove unnecessary global, hidden field and setAction from HTMLForm

https://gerrit.wikimedia.org/r/487653

Change 473066 abandoned by Jayprakash12345:
Remove unnecessary hidden field from HTMLForm

Reason:
Get it wrong

https://gerrit.wikimedia.org/r/473066

From @Tgr in https://gerrit.wikimedia.org/r/#/q/I427551a7b7e8d7a85dcca0b30921466de81f9b6a

The hidden 'title' field and setting the action to $wgScript are both things that are handled by HTMLForm internally. Maybe when ListSignup was written that wasn't the case yet, but it would have to be very old for that, I think.

Change 487653 abandoned by VolkerE:
Remove unnecessary global, hidden field and setAction from HTMLForm

Reason:
Similar to I05ba34073c71e5be

https://gerrit.wikimedia.org/r/487653

Change 473065 abandoned by VolkerE:

[mediawiki/extensions/ConfirmAccount@master] Remove unnecessary hidden field from HTMLForm

Reason:

Similar to I05ba34073c71e5be

https://gerrit.wikimedia.org/r/473065

Volker_E assigned this task to Jayprakash12345.