Author: jablko
Date: Mon Oct 25 10:08:48 2010
New Revision: 8467
Log:
Set parent once
Modified:
trunk/apps/qubit/modules/term/actions/editAction.class.php
Modified: trunk/apps/qubit/modules/term/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/term/actions/editAction.class.php Mon Oct 25
10:03:34 2010 (r8466)
+++ trunk/apps/qubit/modules/term/actions/editAction.class.php Mon Oct 25
10:08:48 2010 (r8467)
@@ -45,6 +45,8 @@
$this->form->getValidatorSchema()->setOption('allow_extra_fields', true);
$this->resource = new QubitTerm;
+ $this->resource->parentId = QubitTerm::ROOT_ID;
+
if (isset($this->getRoute()->resource))
{
$this->resource = $this->getRoute()->resource;
@@ -79,10 +81,6 @@
$params =
$this->context->routing->parse(Qubit::pathInfo($request->parent));
$this->resource->parentId = $params['id'];
}
- else
- {
- $this->resource->parentId = QubitTerm::ROOT_ID;
- }
if (isset($request->taxonomyId))
{
@@ -434,13 +432,6 @@
{
parent::processForm();
- // Assign root node as parent, if another parent (broad-term) is not
- // selected
- if (!isset($this->resource->parent))
- {
- $this->resource->parentId = QubitTerm::ROOT_ID;
- }
-
$this->resource->save();
// Update related info objects when term labels changes
--
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.com/group/qubit-commits?hl=en.