Skip to content

Commit

Permalink
If article has multible parents, then it often returns wrong parent d…
Browse files Browse the repository at this point in the history
…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 4587292
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions classes/sapi/function.init_article.php
Expand Up @@ -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
Expand Down

0 comments on commit 4587292

Please sign in to comment.