Skip to content

Commit

Permalink
adding fix for attributes (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic authored Jun 25, 2024
1 parent 07400c8 commit 638167c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

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

## [8.0.6]

### Fixed
- default attributes render will not throw error if attribute key is missing in component manifest.

## [8.0.5]

### Fixed
Expand Down Expand Up @@ -576,6 +581,7 @@ Init setup

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

[8.0.6]: https://github.com/infinum/eightshift-libs/compare/8.0.5...8.0.6
[8.0.5]: https://github.com/infinum/eightshift-libs/compare/8.0.4...8.0.5
[8.0.4]: https://github.com/infinum/eightshift-libs/compare/8.0.3...8.0.4
[8.0.3]: https://github.com/infinum/eightshift-libs/compare/8.0.2...8.0.3
Expand Down
6 changes: 4 additions & 2 deletions src/Helpers/AttributesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,13 @@ private static function getDefaultRenderAttributes(array $manifest, array $attri
{
$defaultAttributes = [];

if (!\is_iterable($manifest['attributes'])) {
$attrs = $manifest['attributes'] ?? [];

if (!\is_iterable($attrs)) {
return [];
}

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

Expand Down

0 comments on commit 638167c

Please sign in to comment.