Skip to content

Commit

Permalink
Tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jan 4, 2025
1 parent bd9e147 commit faa7730
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Field/Configurator/BooleanConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
$isRenderedAsSwitch = true === $field->getCustomOption(BooleanField::OPTION_RENDER_AS_SWITCH);

if ($isRenderedAsSwitch) {

$crudDto = $context->getCrud();

if (null !== $crudDto && Action::NEW !== $crudDto->getCurrentAction()) {
if (null !== $crudDto && null !== $entityDto->getPrimaryKeyValue()) {
$toggleUrl = $this->adminUrlGenerator
->setController($crudDto->getControllerFqcn())
->setAction(Action::EDIT)
Expand Down

0 comments on commit faa7730

Please sign in to comment.