Not getting new versions on Save or Publish of data objects

The only version shown is the one when the object is created. But editing does not create new versions. I’m only getting this for data objects. Versions are working for assets and documents. I have # of versions set to the default (10).

I don’t see any errors. Any suggestions on how to troubleshoot this? I’m on v5.7.3

Thank you!

It’s working again. There was an “onPreUpdate” Element event for my product object. Disabling it fixed the versioning issue. I’ll have to go over that code and figure out what happened.

Looking at this, there was a ProductListener class, that looked for an instance of ‘product’. If this code is included, then data object versioning stops working for ALL data type classes. If I remove the class and it’s service reference, then versioning starts working again. Here’s the code. I’ve stepped through it in the debugger for an non-product, and it’s just skips over the … code. So it’s not really doing anything but versioning stops working. Please help! Thanks!

class ProductListener
{
public function __construct()
{
$this->importService = new ImportService();
}

public function onPreUpdate(ElementEventInterface $e)
{
    if ($e instanceof DataObjectEvent && $e->getObject()->getType() != "folder") {
        $object = $e->getObject();

        if (strtolower($object->getClassName()) == 'product' && ($object instanceof Product)) {
            ....
        }
}
}

}

I would assume that versioning is done by an event handler also. which in your case would run later. So if your code breaks the chain the code after might not run …