Skip to content

Commit

Permalink
Fix slug for no translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofandel committed Dec 4, 2024
1 parent ea4979d commit bd18763
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Behaviors/HasSlug.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public function getSlugParams(?string $locale = null, bool $skipUnchanged = fals
if ($appLocale === $locale || $locale === null) {
$wasChanged = $this->wasRecentlyCreated;

$translation = $this->translate($appLocale, $this->usePropertyFallback());
$translation = method_exists($this, 'translate') ? $this->translate($appLocale, $this->usePropertyFallback()) : null;
$getAttributeValue = function ($attribute) use ($translatedAttributes, $appLocale, $translation, &$wasChanged) {
if (in_array($attribute, $translatedAttributes)) {
if (!$wasChanged && $translation?->isDirty($attribute)) {
Expand Down

0 comments on commit bd18763

Please sign in to comment.