Permalink
Browse files

Fix some errors with merging page & asset data

  • Loading branch information...
1 parent 1b4a03c commit 373b3167247feb85239bb2f5f7cbf57f0f2b9800 @kolber committed May 29, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 app/asset-types/asset-factory.inc.php
@@ -13,7 +13,7 @@ static function extract_page_data($asset_path) {
# return any page data scoped against the asset filename
$page_data = self::$store[$page_path];
- return $page_data[$file_name];
+ return isset($page_data[$file_name]) ? $page_data[$file_name] : false;
}
static function &create($file_path) {
@@ -42,7 +42,8 @@ static function &create($file_path) {
$page_data = self::extract_page_data($file_path);
# create a new asset and return its data
$asset = new $asset($file_path);
- return array_merge($asset->data, is_array($page_data) ? $page_data : array());
+ $merged_data = array_merge($asset->data, is_array($page_data) ? $page_data : array());
+ return $merged_data;
} else {
# new page

0 comments on commit 373b316

Please sign in to comment.