Skip to content

Commit 638167c

Browse files
authored
adding fix for attributes (#412)
1 parent 07400c8 commit 638167c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
33

44
This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).
55

6+
## [8.0.6]
7+
8+
### Fixed
9+
- default attributes render will not throw error if attribute key is missing in component manifest.
10+
611
## [8.0.5]
712

813
### Fixed
@@ -576,6 +581,7 @@ Init setup
576581

577582
[Unreleased]: https://github.com/infinum/eightshift-libs/compare/main...HEAD
578583

584+
[8.0.6]: https://github.com/infinum/eightshift-libs/compare/8.0.5...8.0.6
579585
[8.0.5]: https://github.com/infinum/eightshift-libs/compare/8.0.4...8.0.5
580586
[8.0.4]: https://github.com/infinum/eightshift-libs/compare/8.0.3...8.0.4
581587
[8.0.3]: https://github.com/infinum/eightshift-libs/compare/8.0.2...8.0.3

src/Helpers/AttributesTrait.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,13 @@ private static function getDefaultRenderAttributes(array $manifest, array $attri
244244
{
245245
$defaultAttributes = [];
246246

247-
if (!\is_iterable($manifest['attributes'])) {
247+
$attrs = $manifest['attributes'] ?? [];
248+
249+
if (!\is_iterable($attrs)) {
248250
return [];
249251
}
250252

251-
foreach ($manifest['attributes'] as $itemKey => $itemValue) {
253+
foreach ($attrs as $itemKey => $itemValue) {
252254
// Get the correct key for the check in the attributes object.
253255
$newKey = self::getAttrKey($itemKey, $attributes, $manifest);
254256

0 commit comments

Comments
 (0)