EntityFormModeAddForm.php in Drupal 10
File
core/modules/field_ui/src/Form/EntityFormModeAddForm.php
View source
<?php
namespace Drupal\field_ui\Form;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class EntityFormModeAddForm extends EntityDisplayModeAddForm {
protected function prepareEntity() {
$definition = $this->entityTypeManager
->getDefinition($this->targetEntityTypeId);
if (!$definition
->get('field_ui_base_route') || !$definition
->hasFormClasses()) {
throw new NotFoundHttpException();
}
$this->entity
->setTargetType($this->targetEntityTypeId);
}
}