Jcf2000 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/98011
Change subject: Addressed Bug 57592: Retains form input on POST error
......................................................................
Addressed Bug 57592: Retains form input on POST error
Change-Id: Iafa210c12bbcd0633ddfb0b3edffd83774fc13cd
---
M repo/includes/specials/SpecialModifyEntity.php
M repo/includes/specials/SpecialSetSiteLink.php
2 files changed, 24 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/11/98011/1
diff --git a/repo/includes/specials/SpecialModifyEntity.php
b/repo/includes/specials/SpecialModifyEntity.php
index 412dd8f..95a2b74 100644
--- a/repo/includes/specials/SpecialModifyEntity.php
+++ b/repo/includes/specials/SpecialModifyEntity.php
@@ -263,13 +263,16 @@
),
$this->msg( 'wikibase-setentity-id' )->text()
)
- . Html::input(
- 'id',
- $id,
- 'text',
+ //Changed Input() to rawElement() to allow for "value" parameter
+ //Retains previous ID information
+ . Html::rawElement(
+ 'input',
array(
+ 'name'=>'id',
+ 'type'=>'text',
'class' => 'wb-input',
- 'id' => 'wb-setentity-id'
+ 'id' => 'wb-setentity-id',
+ 'value' => $this->getRequest()->getVal( 'id' )
)
)
. Html::element( 'br' );
diff --git a/repo/includes/specials/SpecialSetSiteLink.php
b/repo/includes/specials/SpecialSetSiteLink.php
index 8038cdf..956f32d 100644
--- a/repo/includes/specials/SpecialSetSiteLink.php
+++ b/repo/includes/specials/SpecialSetSiteLink.php
@@ -164,14 +164,17 @@
if ( $this->page === null ) {
$this->page = $this->getSiteLink( $this->entityContent,
$this->site );
}
- $pageinput = Html::input(
- 'page',
- $this->page,
- 'text',
+ //Changed Input() to rawElement() to allow for "value" parameter
+ //Retains previous page information
+ $pageinput = Html::rawElement(
+ 'input',
array(
+ 'name' => 'page',
+ 'type' => 'text',
'class' => 'wb-input wb-input-text',
'id' => 'wb-setsitelink-page',
- 'size' => 50
+ 'size' => 50,
+ 'value' => $this->getRequest()->getVal( 'page' )
)
)
. Html::element( 'br' );
@@ -208,13 +211,16 @@
),
$this->msg( 'wikibase-setsitelink-site'
)->text()
)
- . Html::input(
- 'site',
- $this->site,
- 'text',
+ //Changed Input() to rawElement() to allow for "value"
parameter
+ //Retains previous Site ID information
+ . Html::rawElement(
+ 'input',
array(
+ 'name'=>'site',
+ 'type'=>'text',
'class' => 'wb-input',
- 'id' => 'wb-setsitelink-site'
+ 'id' => 'wb-setsitelink-site',
+ 'value' => $this->getRequest()->getVal(
'site' )
)
)
. Html::element( 'br' )
--
To view, visit https://gerrit.wikimedia.org/r/98011
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafa210c12bbcd0633ddfb0b3edffd83774fc13cd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jcf2000 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits