src/VersionedGridFieldItemRequest.php
public function saveFormIntoRecord($data, $form)
    {
        $record = parent::saveFormIntoRecord($data, $form);

        // Note: Don't publish if versioned, since that's a separate action
        $ownerIsVersioned = $record && $record->hasExtension(Versioned::class);
        $ownerIsPublishable = $record && $record->hasExtension(RecursivePublishable::class);
        if ($ownerIsPublishable && !$ownerIsVersioned) {
            /** @var RecursivePublishable $record */
            $record->publishRecursive();
        }

        return $record;
    }
public function saveFormIntoRecord($data, $form)
    {
        $record = parent::saveFormIntoRecord($data, $form);

        // Note: Don't publish if versioned, since that's a separate action
        $ownerIsVersioned = $record && $record->hasExtension(Versioned::class);
        $ownerIsPublishable = $record && $record->hasExtension(RecursivePublishable::class);
        if ($ownerIsPublishable && !$ownerIsVersioned) {
            /** @var RecursivePublishable $record */
            $record->publishRecursive();
        }

        return $record;
    }
public function saveFormIntoRecord ( $ data , $ form ) { $ record = parent :: saveFormIntoRecord ( $ data , $ form ) ; // Note: Don't publish if versioned, since that's a separate action $ ownerIsVersioned = $ record && $ record -> hasExtension ( Versioned :: class ) ; $ ownerIsPublishable = $ record && $ record -> hasExtension ( RecursivePublishable :: class ) ; if ( $ ownerIsPublishable && ! $ ownerIsVersioned ) { /** @var RecursivePublishable $record */ $ record -> publishRecursive ( ) ; } return $ record ; }
If a record is recursive publishable, but not versioned, all saves should trigger a recursive publish.

@param array $data
@param Form $form
@return DataObject $record
If a record is recursive publishable but not versioned all saves should trigger a recursive publish .