- Issue created by @dioni
In the file quickedit.module, hook_preprocess_field, if $entity is NULL the module display the typical "The website encountered an error" page because it is calling the function getFieldDefinition on null.
It is really dificult to replicate:
I have a field of type 'link', multiple. 2 of these links are links to public files, 1 is failing.
Instead of displaying an error , we could check if $entity is NULL as part of the first check.
Current:
if (!\Drupal::currentUser()->hasPermission('access in-place editing') || ($entity instanceof RevisionableInterface && !$entity->isLatestRevision())) {
return;
}
Update:
if (!\Drupal::currentUser()->hasPermission('access in-place editing') || empty($entity) || ($entity instanceof RevisionableInterface && !$entity->isLatestRevision())) {
return;
}
In this way, quickedit 'fail' gracefully instead of breaking the page
Active
1.0
Code