Skip to content

Instantly share code, notes, and snippets.

@nikunjkotecha
Created October 6, 2017 05:33
Show Gist options
  • Save nikunjkotecha/a5c918c802c2f0e90e5e5366613a301e to your computer and use it in GitHub Desktop.
Save nikunjkotecha/a5c918c802c2f0e90e5e5366613a301e to your computer and use it in GitHub Desktop.
Code reference that didn't work
<?php
/**
* Update status field.
*/
function comment_update_8300() {
$entity_definition_update_manager = \Drupal::service('entity.definition_update_manager');
$field_definition = $entity_definition_update_manager->getFieldStorageDefinition('status', 'comment');
$field_definition->setDescription(new TranslatableMarkup('A boolean indicating the published state.'))
->setRevisionable(TRUE);
$entity_definition_update_manager->updateFieldStorageDefinition($field_definition);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment