-
Notifications
You must be signed in to change notification settings - Fork 351
Closed
Labels
BugError or unexpected behavior of already existing functionalityError or unexpected behavior of already existing functionality
Description
Q | A |
---|---|
Sulu Version | 2.6.9 |
PHP Version | 8.3.17 |
DB Version | unrelated |
Browser Version | unrelated |
Actual Behavior
When using the single_icon_selection with the shipped Icomoon-Provider in dev environment, a warning is emmitted, which is turned into an exception and no icons are shown:
request.CRITICAL: Uncaught PHP Exception ErrorException: "Warning: Undefined array key 0" at IcomoonProvider.php line 53 {"exception":"[object] (ErrorException(code: 0): Warning: Undefined array key 0 at /var/www/html/vendor/sulu/sulu/src/Sulu/Bundle/AdminBundle/Icon/providers/IcomoonProvider.php:53)"} []
Expected Behavior
The icons should be displayed, even if the value is not correctly filled in the json-file and no warning should be thrown
Steps to Reproduce
- Add
single_icon_selection
with icon_set "sulu" to a template - Open the backend
- Click on the icon selection
Possible Solutions
Replace in file src/Sulu/Bundle/AdminBundle/Icon/providers/IcomoonProvider.php::53
- $attrs = $icon->icon->attrs[$index];
+ $attrs = $icon->icon->attrs[$index] ?? new \stdClass();
Metadata
Metadata
Assignees
Labels
BugError or unexpected behavior of already existing functionalityError or unexpected behavior of already existing functionality