Skip to content

Commit 23e9c81

Browse files
committed
handle a mismatch between an underscored pattern and data file
1 parent f30592d commit 23e9c81

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/PatternLab/PatternData/Helpers/PatternCodeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function run() {
5757
// iterate to process each pattern
5858
foreach ($store as $patternStoreKey => $patternStoreData) {
5959

60-
if ($patternStoreData["category"] == "pattern") {
60+
if (($patternStoreData["category"] == "pattern") && isset($patternStoreData["name"])) {
6161

6262
$data = Data::getPatternSpecificData($patternStoreKey);
6363

src/PatternLab/PatternData/Helpers/RawPatternHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function run() {
4141
// iterate to get raw data loaded into the PatternData Store
4242
foreach ($store as $patternStoreKey => $patternStoreData) {
4343

44-
if ($patternStoreData["category"] == "pattern") {
44+
if (($patternStoreData["category"] == "pattern") && isset($patternStoreData["name"])) {
4545

4646
// figure out the source path for the pattern to render
4747
$srcPath = (isset($patternStoreData["pseudo"])) ? PatternData::getPatternOption($patternStoreData["original"],"pathName") : $patternStoreData["pathName"];
@@ -51,7 +51,7 @@ public function run() {
5151
if (file_exists($path)) {
5252
PatternData::setPatternOption($patternStoreKey,"patternRaw",file_get_contents($path));
5353
} else {
54-
Console::writeError($patternStoreData["partial"]." wasn't found for loading. the given path: ".$path);
54+
Console::writeWarning($patternStoreData["partial"]." wasn't found for loading. the given path: ".$path);
5555
}
5656

5757
}

0 commit comments

Comments
 (0)