src/CoreBundle/EventListener/DcGeneral/MetaModel/CreateVariantButtonListener.php
public function presetVariantBase(PreEditModelEvent $event)
    {
        $model = $event->getModel();

        // Check of we have the driver from MetaModels. Only these request are from interest.
        if (!$model instanceof Model) {
            return;
        }

        // Get the item and check the context.
        $nativeItem = $model->getItem();
        $metaModel  = $nativeItem->getMetaModel();

        if ($metaModel->hasVariants() && (!$nativeItem->get('vargroup'))) {
            $nativeItem->set('varbase', '1');
        }
    }
public function presetVariantBase(PreEditModelEvent $event)
    {
        $model = $event->getModel();

        // Check of we have the driver from MetaModels. Only these request are from interest.
        if (!$model instanceof Model) {
            return;
        }

        // Get the item and check the context.
        $nativeItem = $model->getItem();
        $metaModel  = $nativeItem->getMetaModel();

        if ($metaModel->hasVariants() && (!$nativeItem->get('vargroup'))) {
            $nativeItem->set('varbase', '1');
        }
    }
Check the items before the edit start. If there is a item with variant support and a empty vargroup it must be a
base. So set the varbase to 1.

@param PreEditModelEvent $event The event with the model.

@return void