CMS Made Simple Forums
https://forum.cmsmadesimple.org/

Cannot access protected property Content::$mHierarchyPath
https://forum.cmsmadesimple.org/viewtopic.php?f=80&t=61676
Page 1 of 1

Author:  brunettdan [ Sun Jun 24, 2012 11:08 pm ]
Post subject:  Cannot access protected property Content::$mHierarchyPath

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:
\$1:
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?

Author:  calguy1000 [ Sun Jun 24, 2012 11:10 pm ]
Post subject:  Re: Cannot access protected property Content::$mHierarchyPat

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.

Author:  brunettdan [ Sun Jun 24, 2012 11:14 pm ]
Post subject:  Re: Cannot access protected property Content::$mHierarchyPat

Ty, found a related post
viewtopic.php?f=3&t=57503

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/