Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #363 from rasenplanscher/master
Browse files Browse the repository at this point in the history
Fix data-merging for pseudo-patterns
  • Loading branch information
dmolsen authored Jul 7, 2016
2 parents e52ced8 + 8da8011 commit 849bc4d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/lib/PatternLab/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ protected function gatherPatternInfo() {

/*************************************
* This section is for:
* JSON psuedo-patterns
* JSON pseudo-patterns
*************************************/

$patternSubtypeInclude = ($patternSubtypeSet) ? $patternSubtype."-" : "";
Expand Down Expand Up @@ -759,7 +759,7 @@ protected function gatherPatternInfo() {
}

// get the special pattern data
$patternData = (array) json_decode(file_get_contents($object->getPathname()));
$patternData = (array) json_decode(file_get_contents($object->getPathname()),true);
$this->jsonLastErrorMsg($object->getFilename());

// merge them for the file
Expand All @@ -768,11 +768,9 @@ protected function gatherPatternInfo() {
$this->d["patternSpecific"][$patternPartial]["data"] = array();
$this->d["patternSpecific"][$patternPartial]["listItems"] = array();
}

if (is_array($patternDataBase) && is_array($patternData)) {
$this->d["patternSpecific"][$patternPartial]["data"] = array_merge($patternDataBase, $patternData);
$this->d["patternSpecific"][$patternPartial]["data"] = array_replace_recursive($patternDataBase, $patternData);
}

}

} else if ($object->isFile() && ($object->getExtension() == "json")) {
Expand Down

0 comments on commit 849bc4d

Please sign in to comment.