Permalink
Browse files

If article has multible parents, then it often returns wrong parent d…

…ata. This quick fix makes it little better, but does not fix it completly.
  • Loading branch information...
kempu committed May 17, 2012
1 parent 8d9460f commit 4587292b47beb3404eea76671c50bef738929382
Showing with 11 additions and 3 deletions.
  1. +11 −3 classes/sapi/function.init_article.php
@@ -115,9 +115,17 @@ function smarty_function_init_article ($params,&$smarty) {
##############
# luua objekt
- $obj = new Objekt(array(
- objekt_id => $id,
- ));
+
+ $objSettings = array();
+ $objSettings['objekt_id'] = $id;
+ $obj = new Objekt($objSettings);
+
+ $allObjParents = $obj->get_obj_all_parents($objSettings['objekt_id']);
+
+ if(in_array($leht->parents->list[0]->parent_id, $allObjParents)) {
+ $objSettings['parent_id'] = $leht->parents->list[0]->parent_id;
+ $obj = new Objekt($objSettings);
+ }
##############
# minna edasi vaid siis kui tegemist on artikliga

0 comments on commit 4587292

Please sign in to comment.