mirror of
https://github.com/flarum/core.git
synced 2025-08-01 14:10:37 +02:00
fix: slug generation uses actor locale instead of forum default
This commit is contained in:
committed by
Daniël Klabbers
parent
6ca2ebc437
commit
6c57470b13
@@ -22,6 +22,7 @@ use Flarum\Locale\LocaleManager;
|
||||
use Flarum\Notification\Notification;
|
||||
use Flarum\Post\MergeableInterface;
|
||||
use Flarum\Post\Post;
|
||||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
use Flarum\User\User;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -446,6 +447,10 @@ class Discussion extends AbstractModel
|
||||
protected function setTitleAttribute($title)
|
||||
{
|
||||
$this->attributes['title'] = $title;
|
||||
$this->slug = Str::slug($title, '-', resolve(LocaleManager::class)->getLocale());
|
||||
$this->slug = Str::slug(
|
||||
$title,
|
||||
'-',
|
||||
resolve(SettingsRepositoryInterface::class)->get('default_locale', 'en')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user