Page 1 of 1

Cannot access protected property Content::$mHierarchyPath

Posted: Sun Jun 24, 2012 11:08 pm
by brunettdan
Getting the following error when trying to use a UDT which worked in previous versions (1.9.4.1)

mod_fcgid: stderr: PHP Fatal error: Cannot access protected property Content::$mHierarchyPath in /xxx/xxx/public_html/lib/classes/class.usertagoperations.inc.php(265) : eval()'d code on line 4

UDT I'm trying to use:

Code: Select all

global $smarty;
$op = $smarty->get_template_vars('content_obj');
$current_id = $smarty->get_template_vars('content_id');
$temp = explode('/', $op->mHierarchyPath);
$root_alias = $temp[0];
$temp = explode('.', $op->mIdHierarchy);
$root_id = $temp[0];
if ($temp[0] == $current_id){
$is_root = 1;
$page_level = 1;
}
else{
  $is_root = 0;
  $page_level = array_search($current_id, $temp, true);
  $page_level++;
}
$smarty->assign('language',$root_alias);
Also tried cloning $op->mHierarchyPath, as well as $op->mHierarchyPath(). None worked. Any suggestions?

Re: Cannot access protected property Content::$mHierarchyPat

Posted: Sun Jun 24, 2012 11:10 pm
by calguy1000
We invalidated most (if not all) access to properties such as this in CMSMS 1.10. Properties of content objects are now protected or private. You must use the appropriate accessors now.

Re: Cannot access protected property Content::$mHierarchyPat

Posted: Sun Jun 24, 2012 11:14 pm
by brunettdan