Merged 9.2.13.

merge-requests/1247/head
xjm 2022-02-15 14:26:36 -06:00
commit 14259fd34f
2 changed files with 6 additions and 2 deletions

View File

@ -1218,7 +1218,7 @@ class FormBuilder implements FormBuilderInterface, FormValidatorInterface, FormS
// #access=FALSE on an element usually allow access for some users, so forms // #access=FALSE on an element usually allow access for some users, so forms
// submitted with self::submitForm() may bypass access restriction and be // submitted with self::submitForm() may bypass access restriction and be
// treated as high-privilege users instead. // treated as high-privilege users instead.
$process_input = empty($element['#disabled']) && (($form_state->isProgrammed() && $form_state->isBypassingProgrammedAccessChecks()) || ($form_state->isProcessingInput() && (!isset($element['#access']) || $element['#access']))); $process_input = empty($element['#disabled']) && ($element['#type'] !== 'value') && (($form_state->isProgrammed() && $form_state->isBypassingProgrammedAccessChecks()) || ($form_state->isProcessingInput() && (!isset($element['#access']) || $element['#access'])));
// Set the element's #value property. // Set the element's #value property.
if (!isset($element['#value']) && !array_key_exists('#value', $element)) { if (!isset($element['#value']) && !array_key_exists('#value', $element)) {

View File

@ -5,6 +5,7 @@ namespace Drupal\quickedit;
use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\quickedit\Access\QuickEditEntityFieldAccessCheckInterface; use Drupal\quickedit\Access\QuickEditEntityFieldAccessCheckInterface;
use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\Core\Entity\Entity\EntityViewDisplay;
@ -55,7 +56,10 @@ class MetadataGenerator implements MetadataGeneratorInterface {
*/ */
public function generateEntityMetadata(EntityInterface $entity) { public function generateEntityMetadata(EntityInterface $entity) {
return [ return [
'label' => $entity->label(), 'label' => $entity->access('view label') ? $entity->label() : new TranslatableMarkup('@label @id', [
'@label' => $entity->getEntityType()->getSingularLabel(),
'@id' => $entity->id()
])
]; ];
} }