summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/controllers/welcome.php3
-rw-r--r--core/models/item.php7
2 files changed, 1 insertions, 9 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php
index ce039ead..d4261cc4 100644
--- a/core/controllers/welcome.php
+++ b/core/controllers/welcome.php
@@ -235,11 +235,10 @@ class Welcome_Controller extends Template_Controller {
$tag->name = $tags_list[$idx];
$tag->save();
}
- if (!$item->add($tag)) {
+ if (!$tag->add($item, $tag)) {
throw new Exception("@todo {$tag->name} WAS_NOT_ADDED_TO {$item->id}");
}
}
- $item->save();
}
url::redirect("welcome");
diff --git a/core/models/item.php b/core/models/item.php
index ba759c2b..4481a3a9 100644
--- a/core/models/item.php
+++ b/core/models/item.php
@@ -21,13 +21,6 @@ class Item_Model extends ORM_MPTT {
protected $children = 'items';
protected $has_one = array("owner" => "user");
- function __construct($id=null) {
- parent::__construct($id);
- if (!in_array("tags", $this->has_and_belongs_to_many) && module::is_installed("tag")) {
- $this->has_and_belongs_to_many[] = "tags";
- }
- }
-
/**
* Is this item an album?
* @return true if it's an album