Contributions 1 min read

# Validation errors with subItems without context stack fix

Our Pimcore developer, Tomislav, has solved another issue on the Pimcore platform. Find out why this pull request is important and what use will users have from this fix!

Last updated on 29 August, 2025

## Key takeaways

1. Saving a Pimcore object with an empty mandatory classification store field showed a PHP error because the code accessed an empty array.
2. The fix by a Factory developer checks whether the array contains values before building the validation error message.
3. After the fix, users see that the save failed because they left a mandatory field empty instead of an unclear PHP error.

## **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](https://github.com/pimcore/pimcore/pull/10362), just follow the link!

## Related

[Contributions **Added async option to headscript fix** Check out one of our Pimcore developers helped add the async option to the headscript, and bringing closer the release of Pimcore X! 1 min read](https://factory.dev/pimcore-knowledge-base/contributions/added-async-option-headscript-fix) [Contributions **Fix for image assets that don’t have set dimensions** Tomislav, our Pimcore developer, has done it again and his new pull request has been accepted. Image assets have been causing some lesser issues, and now the issue… 1 min read](https://factory.dev/pimcore-knowledge-base/contributions/image-assets-fix) [Contributions **Vimeo and Dailymotion video editable fix** Our Pimcore developer Tomislav has made a huge fix recently! Find out what needed to be done in order to enable users to add videos from Vimeo and… 1 min read](https://factory.dev/pimcore-knowledge-base/contributions/vimeo-dailymotion-video-editable-fix)

---

Source: https://factory.dev/pimcore-knowledge-base/contributions/validation-errors-fix
