Classification store key deletion fix

What was the issue? 

The problem was with classification store keys. When you delete the key from the classification store it wouldn’t delete it from the classification store group that contains it. That leads to objects still having deleted keys as their field.

How did you solve it? 

Problem was that the Pimcore team implemented soft delete of the classification store keys. Instead of calling a function that deletes the key from the database, it calls a function that updates that key and sets its attribute “enabled” to 0.

I added a condition in the function that updates the key, that checks if the field that is being updated is “enabled” and is being updated to value 0. If the condition is true then it would remove the key from all the groups that contained it.

Why is this fix important?

This is important because classification store keys are used for making object fields that not all instances of objects contain. And if we remove a key from a classification store it means that for some reason we don’t need that information anymore. It could be because all instances of objects now must have that attribute or because that attribute is not used anymore.

No matter what is the reason we wouldn’t need to fill out that attribute anymore, so if we delete the key from a classification store but it still persists in the classification store group we would still need to fill that attribute. It leads to having to do more work, having more data in the database, and ever so slightly slowing down the page loading time.

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

The feeling is amazing. Knowing that anyone can contribute to something this big is fantastic. Even while contributing to the platform, during the merge request, someone from the Pimcore development team took their time to explain something to me. Also, he gave me some advice on how to make my code even more optimized and better overall.

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