Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save junaidpv/370e3b1b8d5df1946bed672f65ddfb29 to your computer and use it in GitHub Desktop.
Save junaidpv/370e3b1b8d5df1946bed672f65ddfb29 to your computer and use it in GitHub Desktop.
Custom patch to help with BWMA migraiton. Not to be used after the migraiton is over.
--- a/src/Plugin/Field/FieldType/EntityReferenceRevisionsItem.php
+++ b/src/Plugin/Field/FieldType/EntityReferenceRevisionsItem.php
@@ -279,7 +279,7 @@
$is_affected = !$this->getFieldDefinition()->isTranslatable() || ($host instanceof TranslatableRevisionableInterface && $host->hasTranslationChanges());
if ($is_affected && !$host->isNew() && $this->entity && $this->entity->getEntityType()->get('entity_revision_parent_id_field')) {
if ($host->isNewRevision()) {
- $this->entity->setNewRevision();
+ $this->entity->setNewRevision(php_sapi_name() != 'cli');
$needs_save = TRUE;
}
// Additionally ensure that the default revision state is kept in sync.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment