Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
[#720](https://github.com/nextcloud/cookbook/pull/720) @christianlupus
- Update compression-webpack-plugin
[#721](https://github.com/nextcloud/cookbook/pull/721) @christianlupus

- Fix array in recipeYields field according to #722
[#725](https://github.com/nextcloud/cookbook/pull/725) @christianlupus

## 0.8.4 - 2021-03-08

### Added
Expand Down
11 changes: 11 additions & 0 deletions lib/Service/RecipeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ public function checkRecipe(array $json): array {

// Make sure that "recipeYield" is an integer which is at least 1
if (isset($json['recipeYield']) && $json['recipeYield']) {

// Check if "recipeYield is an array
if (is_array($json['recipeYield'])) {
if (count($json['recipeYield']) === 1) {
$json['recipeYield'] = $json['recipeYield'][0];
} else {
// XXX How to parse an array correctly?
$json['recipeYield'] = join(' ', $json['recipeYield']);
}
}

$regex_matches = [];
preg_match('/(\d*)/', $json['recipeYield'], $regex_matches);
if (count($regex_matches) >= 1) {
Expand Down