Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Oct 22, 2024
1 parent a423cf3 commit eaaccf6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/elements/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
use Illuminate\Support\Collection;
use Throwable;
use yii\base\Exception;
use yii\base\InvalidArgumentException;
use yii\base\InvalidConfigException;
use yii\db\Expression;

Expand Down Expand Up @@ -905,8 +906,12 @@ protected function shouldValidateTitle(): bool
if (!$entryType->hasTitleField) {
return false;
}
/** @var EntryTitleField $titleField */
$titleField = $entryType->getFieldLayout()->getField('title');
try {
/** @var EntryTitleField $titleField */
$titleField = $entryType->getFieldLayout()->getField('title');
} catch (InvalidArgumentException) {
return true;
}
return $titleField->required;
}

Expand Down

0 comments on commit eaaccf6

Please sign in to comment.