]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix conflict between URL parameter and POST parameter with groups
authorEvan Prodromou <evan@status.net>
Fri, 30 Sep 2011 15:48:00 +0000 (11:48 -0400)
committerEvan Prodromou <evan@status.net>
Fri, 30 Sep 2011 15:48:00 +0000 (11:48 -0400)
Group edit page is at /group/:nickname/edit. There's also a form
parameter named 'nickname'. The two were conflicting.

I changed the form parameter to 'newnickname' and it works.

I'm not sure how this ever worked before, though.

actions/editgroup.php
actions/newgroup.php
lib/groupeditform.php

index 35dd25b896fbedecb7c1476b2acb457beeeffad7..7439b9d030ebb09086543a9854b10d84fd3648e8 100644 (file)
@@ -159,7 +159,7 @@ class EditgroupAction extends GroupAction
     function showScripts()
     {
         parent::showScripts();
-        $this->autofocus('nickname');
+        $this->autofocus('newnickname');
     }
 
     function trySave()
@@ -173,7 +173,7 @@ class EditgroupAction extends GroupAction
 
         if (Event::handle('StartGroupSaveForm', array($this))) {
 
-            $nickname    = Nickname::normalize($this->trimmed('nickname'));
+            $nickname    = Nickname::normalize($this->trimmed('newnickname'));
             $fullname    = $this->trimmed('fullname');
             $homepage    = $this->trimmed('homepage');
             $description = $this->trimmed('description');
index c54e24ed95103226918f16b5e9b7898f058e5e7c..cf3125fd87cf77b9ed491cb7a28e30e7209b570e 100644 (file)
@@ -122,7 +122,7 @@ class NewgroupAction extends Action
     {
         if (Event::handle('StartGroupSaveForm', array($this))) {
             try {
-                $nickname = Nickname::normalize($this->trimmed('nickname'));
+                $nickname = Nickname::normalize($this->trimmed('newnickname'));
             } catch (NicknameException $e) {
                 $this->showForm($e->getMessage());
             }
index b795c1387daa2b5bc64f402fefc12a5f53cc9155..e943dcd19a8b1425f14547e858e06b50d6f2363b 100644 (file)
@@ -144,8 +144,8 @@ class GroupEditForm extends Form
             $this->out->elementStart('li');
             $this->out->hidden('groupid', $id);
             // TRANS: Field label on group edit form.
-            $this->out->input('nickname', _('Nickname'),
-                              ($this->out->arg('nickname')) ? $this->out->arg('nickname') : $nickname,
+            $this->out->input('newnickname', _('Nickname'),
+                              ($this->out->arg('newnickname')) ? $this->out->arg('newnickname') : $nickname,
                               // TRANS: Field title on group edit form.
                               _('1-64 lowercase letters or numbers, no punctuation or spaces.'));
             $this->out->elementEnd('li');