Skip to content
Snippets Groups Projects

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

3 files
+ 35
1
Compare changes
  • Side-by-side
  • Inline
Files
3
  • f2154d58
    Issue #3174924 by joachim, xjm, smustgrave, sourabhjain, ranjith_kumar_k_u,... · f2154d58
    Jess authored
    Issue #3174924 by joachim, xjm, smustgrave, sourabhjain, ranjith_kumar_k_u, kiwimind, catch, bnjmnm: Throw a better exception when a reference field can't find the target entity type
@@ -6,6 +6,7 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Entity\ContentEntityStorageInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\Core\Entity\TypedData\EntityDataDefinition;
@@ -121,7 +122,16 @@ public static function mainPropertyName() {
*/
public static function schema(FieldStorageDefinitionInterface $field_definition) {
$target_type = $field_definition->getSetting('target_type');
$target_type_info = \Drupal::entityTypeManager()->getDefinition($target_type);
try {
$target_type_info = \Drupal::entityTypeManager()->getDefinition($target_type);
}
catch (PluginNotFoundException $e) {
throw new FieldException(sprintf("Field '%s' on entity type '%s' references a target entity type '%s' which does not exist.",
$field_definition->getName(),
$field_definition->getTargetEntityTypeId(),
$target_type
));
}
$properties = static::propertyDefinitions($field_definition)['target_id'];
if ($target_type_info->entityClassImplements(FieldableEntityInterface::class) && $properties->getDataType() === 'integer') {
$columns = [
Loading