CmsLayoutTemplateType::load("__CORE__::Page");
CmsLayoutTemplateType::load(1);
won't work :
CmsLayoutTemplateType::load("Core::Page");
CmsLayoutTemplateType::load("core::page");
CmsLayoutTemplateType::load("Core::whatever");
to fix that : in lib/classes/class.CmsLayoutTemplateType.php there is an error into the function &load($val) (line 573)
the patch/diff : https://github.com/besstiolle/f2/commit ... 7b0c70f6cd
/**
* Load a CmsLayoutTemplateType object from the database.
*
* This method throws an exception when the requested object cannot be found.
*
* @param mixed $val An integer template type id, or a string in the form of Originator::Name
* @return CmsLayoutTemplateType
*/
public static function &load($val)
{
$db = cmsms()->GetDb();
$row = null;
if( (int)$val > 0 ) {
if( isset(self::$_cache[$val]) ) return self::$_cache[$val];
$query = 'SELECT * FROM '.cms_db_prefix().self::TABLENAME.' WHERE id = ?';
$row = $db->GetRow($query,array($val));
}
elseif( strlen($val) > 0 ) {
if( isset(self::$_name_cache[$val]) ) {
$id = self::$_name_cache[$val];
return self::$_cache[$id];
}
$tmp = explode('::',$val);
if( count($tmp) == 2 ) {
$query = 'SELECT * FROM '.cms_db_prefix().self::TABLENAME.' WHERE originator = ? AND name = ?';
if( $tmp[0] == 'Core' or $tmp[0] == 'core' ) $tmp[0] == self::CORE;
$row = $db->GetRow($query,array(trim($tmp[0]),trim($tmp[1])));
}
}
if( !is_array($row) || count($row) == 0 ) throw new CmsDataNotFoundException('Could not find template type identified by '.$val);
return self::_load_from_data($row);
}