Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

taxonomy by normal tag via excpetion catching

  • Loading branch information...
commit 19c1ad281dd6e2ea259cd10b41c502a6679f5806 1 parent d82d75d
@KellyLSB KellyLSB authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 extend/sql/library/extensions/taxonomy.php
View
10 extend/sql/library/extensions/taxonomy.php
@@ -68,8 +68,14 @@ public function modelRemoveTag(Model $model) {
if(count($args) > 0) if(is_array($args[0])) $args = $args[0];
foreach($args as $map) {
- if($map instanceof Model);
- else $map = e::map($map);
+ try {
+ if($map instanceof Model);
+ else $map = e::map($map);
+ }
+
+ catch(MapException $e) {
+ $map = e::$taxonomy->getTag($map);
+ }
$q = e::$sql->query("DELETE FROM `$tagTable` WHERE `owner` = '$model->id' AND `model` = '".$map->__map('bundlename')."' AND `model-id` = '$map->id'");
Please sign in to comment.
Something went wrong with that request. Please try again.