Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: Inherit UsercreateTemplate for User{login|create} templates to 
fix T102775
......................................................................

Inherit UsercreateTemplate for User{login|create} templates to fix T102775

AntiSpoof needs addInputItem from UsercreateTemplate to work. We reuse the hook,
so we need to extend this class in our own login/create templates.

For now we use UsercreateTemplate for Usercreate as well as for Userlogin 
templates,
which works, because UserlocinTemplate doesn't implement any other functions 
except
execute(). A solution to solve this would be to get rid of the special mobile 
templates
and use core login page.

Bug: T102775
Change-Id: I5eaa48a794ab461eb07ecc46810d4fb34f5e8bc3
---
M includes/skins/UserLoginAndCreateTemplate.php
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/48/218948/1

diff --git a/includes/skins/UserLoginAndCreateTemplate.php 
b/includes/skins/UserLoginAndCreateTemplate.php
index 763f99e..fa97a39 100644
--- a/includes/skins/UserLoginAndCreateTemplate.php
+++ b/includes/skins/UserLoginAndCreateTemplate.php
@@ -9,8 +9,12 @@
  * Facilitates hijacking existing account creation/login template objects
  * by copying their properties to this new template, and exposing some
  * special mobile-specific magic.
+ *
+ * This class implements UsercreateTemplate instead of BaseTemplate due to 
T102775.
+ * It's save to extend this class only until UserloginTemplate doesn't get 
functions,
+ * which are needed by our own Userlogin template.
  */
-abstract class UserLoginAndCreateTemplate extends BaseTemplate {
+abstract class UserLoginAndCreateTemplate extends UsercreateTemplate {
 
        /**
         * Overload the parent constructor
@@ -18,7 +22,7 @@
         * Does not call the parent's constructor to prevent overwriting
         * $this->data and $this->translatorobject since we're essentially
         * just hijacking the existing template and its data here.
-        * @param BaseTemplate $template The original template object to 
overwrite
+        * @param UsercreateTemplate $template The original template object to 
overwrite
         */
        public function __construct( $template ) {
                $this->copyObjectProperties( $template );
@@ -63,7 +67,7 @@
 
        /**
         * Copy public properties of one object to this one
-        * @param BaseTemplate $tpl The object whose properties should be copied
+        * @param UsercreateTemplate $tpl The object whose properties should be 
copied
         */
        protected function copyObjectProperties( $tpl ) {
                foreach ( get_object_vars( $tpl ) as $prop => $value ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/218948
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5eaa48a794ab461eb07ecc46810d4fb34f5e8bc3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to