function lightning_workflow_preprocess_field in Lightning Workflow 8
Same name and namespace in other branches
- 8.3 lightning_workflow.module \lightning_workflow_preprocess_field()
- 8.2 lightning_workflow.module \lightning_workflow_preprocess_field()
Implements template_preprocess_field().
File
- ./
lightning_workflow.module, line 69 - Provides workflow enhancements for Drupal.
Code
function lightning_workflow_preprocess_field(array &$variables) {
if (\Drupal::moduleHandler()
->moduleExists('quickedit')) {
quickedit_preprocess_field($variables);
/** @var \Drupal\Core\Entity\EntityInterface $entity */
$entity = $variables['element']['#object'];
if ($entity instanceof EntityPublishedInterface && $entity
->isPublished() && RouteSubscriber::isViewing($entity)) {
unset($variables['attributes']['data-quickedit-field-id']);
}
}
}