Skip to content

Instantly share code, notes, and snippets.

@mikeyp
Created June 23, 2015 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeyp/c351133ee21bc11faaf8 to your computer and use it in GitHub Desktop.
Save mikeyp/c351133ee21bc11faaf8 to your computer and use it in GitHub Desktop.
<?php
$map = \Drupal::entityManager()->getFieldMap();
dsm($map);
<?php
$defs = \Drupal::entityManager()->getFieldDefinitions('node', 'sponsor');
foreach ($defs as $def) {
\Drupal::entityManager()->onFieldDefinitionCreate($def);
}
@mikeyp
Copy link
Author

mikeyp commented Jun 23, 2015

Building a Drupal 8 view and have missing fields? Check if they are in the field map, and have correct bundle data, and if not, run the snippet below for each entity/bundle type that needs updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment