mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Fix core merge template arrays issue (fixes page templates issue as well)
This commit is contained in:
@@ -1985,21 +1985,18 @@ class e107
|
|||||||
$id = str_replace('/', '_', $id);
|
$id = str_replace('/', '_', $id);
|
||||||
$ret = self::_getTemplate($id, $key, $reg_path, $path, $info);
|
$ret = self::_getTemplate($id, $key, $reg_path, $path, $info);
|
||||||
|
|
||||||
|
### Attempt to fix merge issues; in case we override - template array not found in theme,
|
||||||
|
### so we need to continue and merge with core templates
|
||||||
|
if($merge && $override && empty($ret))
|
||||||
|
{
|
||||||
|
$ret = array();
|
||||||
|
}
|
||||||
|
|
||||||
// if(!$merge || !$override || !is_array($ret)) // problems merging when template doesn't exist in core.
|
if((!$merge && !$override) || is_string($ret))
|
||||||
|
|
||||||
if((!$merge && !$override) || is_string($ret)) //XXX This appears to have less problems, but requires more testing.
|
|
||||||
{
|
{
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_array($ret)) // for the merge below.
|
|
||||||
{
|
|
||||||
$ret = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
// print_a($id ." ". $key ." ". $reg_path." ". $path." ".$info);
|
|
||||||
|
|
||||||
// merge
|
// merge
|
||||||
$reg_path = 'core/e107/templates/'.$id;
|
$reg_path = 'core/e107/templates/'.$id;
|
||||||
$path = self::coreTemplatePath($id, false);
|
$path = self::coreTemplatePath($id, false);
|
||||||
|
11
page.php
11
page.php
@@ -395,9 +395,14 @@ class pageClass
|
|||||||
|
|
||||||
$this->page = $sql->fetch();
|
$this->page = $sql->fetch();
|
||||||
|
|
||||||
$this->template = e107::getCoreTemplate('page', vartrue($this->page['page_template'], 'default'), false, true); // setting override to true breaks default.
|
// setting override to true breaks default.
|
||||||
// $this->template = e107::getCoreTemplate('page', 'default',true,true);
|
$this->template = e107::getCoreTemplate('page', vartrue($this->page['page_template'], 'default'), true, true);
|
||||||
// print_a($this->template);
|
if(!$this->template)
|
||||||
|
{
|
||||||
|
// switch to default
|
||||||
|
$this->template = e107::getCoreTemplate('page', 'default', false, false);
|
||||||
|
}
|
||||||
|
|
||||||
if(empty($this->template))
|
if(empty($this->template))
|
||||||
{
|
{
|
||||||
$this->template = e107::getCoreTemplate('page', 'default');
|
$this->template = e107::getCoreTemplate('page', 'default');
|
||||||
|
Reference in New Issue
Block a user