Skip to content
Snippets Groups Projects

Issue #2707689: NodeForm::actions() checks for delete access on new entities

1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
  • 8dc765f3
    SA-CORE-2022-004 by samuel.mortenson, xjm, nod_, effulgentsia, phenaproxima,... · 8dc765f3
    Jess authored
    SA-CORE-2022-004 by samuel.mortenson, xjm, nod_, effulgentsia, phenaproxima, mcdruid, Wim Leers, tedbow, longwave, dww, larowlan, pandaski
    
    (cherry picked from commit 0ea69dc8)
@@ -5,6 +5,7 @@
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\quickedit\Access\QuickEditEntityFieldAccessCheckInterface;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
@@ -55,7 +56,10 @@ public function __construct(QuickEditEntityFieldAccessCheckInterface $access_che
*/
public function generateEntityMetadata(EntityInterface $entity) {
return [
'label' => $entity->label(),
'label' => $entity->access('view label') ? $entity->label() : new TranslatableMarkup('@label @id', [
'@label' => $entity->getEntityType()->getSingularLabel(),
'@id' => $entity->id()
])
];
}
Loading