Author: jablko
Date: Thu Sep 24 16:33:02 2009
New Revision: 3524

Log:
Don't bind to GET parameters if editing an existing object

Modified:
   trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php
   trunk/apps/qubit/modules/informationobject/actions/editAction.class.php

Modified: trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php Thu Sep 
24 16:28:15 2009        (r3523)
+++ trunk/apps/qubit/modules/digitalobject/actions/editAction.class.php Thu Sep 
24 16:33:02 2009        (r3524)
@@ -46,15 +46,20 @@
 
       $this->informationObject = $this->digitalObject->informationObject;
     }
-    else if (isset($request->informationObject))
+    else
     {
-      $this->informationObject = 
QubitInformationObject::getById($request->informationObject);
-
-      // Check that object exists and that it is not the root
-      if (!isset($this->informationObject) || 
!isset($this->informationObject->parent))
+      if (isset($request->informationObject))
       {
-        $this->forward404();
+        $this->informationObject = 
QubitInformationObject::getById($request->informationObject);
+
+        // Check that object exists and that it is not the root
+        if (!isset($this->informationObject) || 
!isset($this->informationObject->parent))
+        {
+          $this->forward404();
+        }
       }
+
+      $this->form->bind($request->getGetParameters(), $request->getFiles());
     }
 
     $this->form->setValidator('file', new sfValidatorFile);
@@ -97,7 +102,6 @@
       $this->representations = $representations;
     }
 
-    $this->form->bind($request->getGetParameters(), $request->getFiles());
     if ($request->isMethod('post'))
     {
       $this->form->bind($request->getPostParameters(), $request->getFiles());

Modified: 
trunk/apps/qubit/modules/informationobject/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Thu Sep 24 16:28:15 2009        (r3523)
+++ trunk/apps/qubit/modules/informationobject/actions/editAction.class.php     
Thu Sep 24 16:33:02 2009        (r3524)
@@ -240,6 +240,8 @@
     {
       $this->form->setValidator('parent', new sfValidatorString);
       $this->form->setWidget('parent', new sfWidgetFormInputHidden);
+
+      $this->form->bind($request->getGetParameters());
     }
 
     // HACK: Use static::$NAMES in PHP 5.3,
@@ -288,7 +290,6 @@
       }
     }
 
-    $this->form->bind($request->getGetParameters());
     if ($request->isMethod('post'))
     {
       $this->form->bind($request->getPostParameters());

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to