Skip to content

Instantly share code, notes, and snippets.

@steffenr
Created January 30, 2017 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steffenr/269ff14c776f311c0bc69ebe42a99cf6 to your computer and use it in GitHub Desktop.
Save steffenr/269ff14c776f311c0bc69ebe42a99cf6 to your computer and use it in GitHub Desktop.
[Drupal8] make user field configurable in comment
<?php
/**
* Implements hook_entity_base_field_info_alter().
*/
function mymodule_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
switch ($entity_type->id()) {
case 'comment':
$fields['uid']->setDisplayConfigurable('view', TRUE);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment