Validation errors with subItems without context stack fix

What was the issue? 

When trying to save an object with a mandatory classification store field, the error would display a PHP error instead of an error showing the user that he didn’t fill the mandatory field. The error would be shown because the code was trying to access the array on index 0 but the array was empty.

How did you solve it? 

I added a check to see if the array contains any values before accessing its data for creating an error message.

Why is this fix important?

It’s important because the user can now see why the save failed, and also he can see that he forgot to input some data. Before this fix, the user didn’t know if it is his fault or not that the save failed.

How does it feel to contribute to a platform such as Pimcore? 

To know that I helped in the development of something on this scale is amazing.

And if you want to check out this pull request, just follow the link! 

Looking for Exponential Growth? Let’s Get Started.
Explore next

Pimcore guides & How to

Collection of latest concepts, viewpoints and examples from the Pimcore word written by Pimcore industry experts.

Discover more