Update Image varieties using trigger


(Harinder Singh) #1

Matrix Version: 6.26.1

I am trying to configure my trigger to delete all varieties and create them again when an Asset updated event occurs. Although the individual actions (create and delete variety) are working fine, they are not working together.

I have another trigger that creates image varieties when an asset creation event occurs.

Is there something I’m missing?


(Kieran) #2

Heym I recently had issues with triggers and image varieties and was told the system just needs to wait for a minute before continuing. If you could run your delete trigger and then retard your create trigger by a minute (probably less), this might work.

Do you need to delete varieties though? You can remake them I’m pretty sure.
Unless you were replacing a set with a different set. I could be wrong.


(Harinder Singh) #3

Images are occasionally replaced by content editors and for that, image variations must be recreated.

In order to create varieties, the existing variety name must be erased before it can be recreated, but it throws an error if the variety name already exists.


(Kieran) #4

Hi again Harinder,
I assume you are using dynamic image varieties, as you are trying to use a trigger.

If so, there should be no need to regenerate the varieties by trigger. The docs state:

These image varieties are updated when you replace the main image, or make changes to the image using the image editing tools

If you are indeed using dynamic image varieties and the varieties are not getting updated when the image us replaced, I suggest you log this with Squiz via your account manager/mySquiz.


(Harinder Singh) #5

I didnt realise it.

Thanks a lot Kieran :slight_smile: