8000 Fix: error when updating a model after having enabled a new language in the config by Tofandel · Pull Request #2487 · area17/twill · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: error when updating a model after having enabled a new language in the config #2487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Repositories/Behaviors/HandleSlugs.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function beforeSaveHandleSlugs(TwillModelContract $object, array $fields)
$currentSlug = [];
$currentSlug['slug'] = $fields['slug'][$locale];
$currentSlug['locale'] = $locale;
$currentSlug['active'] = $this->model->isTranslatable() ? $object->translate($locale)->active : true;
$currentSlug['active'] = !$this->model->isTranslatable() || $object->translate($locale)?->active ?? false;
$currentSlug = $this->getSlugParameters($object, $fields, $currentSlug);
$object->twillSlugData[] = $currentSlug;
} else {
Expand Down
0