protected function isValidFieldname(FieldStorageConfig $field_storage, FieldableEntityInterface $entity)
 {
     $comment_field_name_ok = FALSE;
     if ($field_storage->getTargetEntityTypeId() !== 'comment') {
         return TRUE;
     }
     $field_name = $field_storage->get('field_name');
     // Check if the 'comment' field name exists on the 'commented' entity type.
     // @todo: Still not waterproof. You could have a field on a non-relevant entity_type.
     foreach (_workflow_info_fields() as $key => $info) {
         if ($info->getName() == $field_name && $info->getTargetEntityTypeId() !== 'comment') {
             $comment_field_name_ok = TRUE;
         }
     }
     return $comment_field_name_ok;
 }
 /**
  * XXXXX.
  * @param \Drupal\field\Entity\FieldStorageConfig $field_storage.
  * @return array
  *   xxx
  */
 protected function buildRow(FieldStorageConfig $field_storage)
 {
     $row = [];
     if ($field_storage->isLocked()) {
         $row[0]['class'] = array('menu-disabled');
         $row[0]['data']['id'] = $this->t('@field_name (Locked)', array('@field_name' => $field_storage->getName()));
     } else {
         $row[0]['data'] = $field_storage->getName();
     }
     $row[1]['data'] = $field_storage->getType();
     $row[2]['data'] = $field_storage->getTargetEntityTypeId();
     $row[3]['data'] = implode(",", $field_storage->getBundles());
     $default_type = $this->fieldPermissions->fieldGetPermissionType($field_storage);
     if ($default_type == FIELD_PERMISSIONS_PUBLIC) {
         $row[4]['data'] = t("Public field (author and administrators can edit, everyone can view)");
         $row[4]['colspan'] = 5;
     } elseif ($default_type == FIELD_PERMISSIONS_PRIVATE) {
         $row[4]['data'] = t("Private field (only author and administrators can edit and view)");
         $row[4]['colspan'] = 5;
     } elseif ($default_type == FIELD_PERMISSIONS_CUSTOM) {
         $row[4]['data'] = t("Custom field Permission ()");
         $row[4]['colspan'] = 5;
     }
     return $row;
 }