mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#5210 bug fixes
This commit is contained in:
parent
f883399623
commit
f3f077f0db
@ -129,18 +129,21 @@ class CategoryController extends AdminController
|
|||||||
$this->createIconFile($category->getId());
|
$this->createIconFile($category->getId());
|
||||||
|
|
||||||
$this->dispatch(new CalculateCategoryLevel($category->getId()));
|
$this->dispatch(new CalculateCategoryLevel($category->getId()));
|
||||||
|
} else {
|
||||||
|
$this->messages->error(trans('visiosoft.module.cats::message.cat_slug_exists', [
|
||||||
|
'slug' => $slug
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->messages->error(trans('visiosoft.module.cats::message.cat_slug_exists', [
|
|
||||||
'slug' => $slug
|
|
||||||
]));
|
|
||||||
} else {
|
} else {
|
||||||
for ($i = 0; $i < count($isMultiCat[0]); $i++) {
|
for ($i = 0; $i < count($isMultiCat[0]); $i++) {
|
||||||
foreach ($isMultiCat as $cat) {
|
foreach ($isMultiCat as $cat) {
|
||||||
$translatableEntries = array_merge($translatableEntries, $cat[$i]);
|
$translatableEntries = array_merge($translatableEntries, $cat[$i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$slug = $this->str->slug(reset($translatableEntries)['name'], '_');
|
$slug = $this->str->slug(
|
||||||
|
collect($translatableEntries)->where('name', '!=', '')->first()['name'],
|
||||||
|
'_'
|
||||||
|
);
|
||||||
if ($this->categoryRepository->findBySlug($slug)) {
|
if ($this->categoryRepository->findBySlug($slug)) {
|
||||||
$this->messages->error(trans('visiosoft.module.cats::message.cat_slug_exists', [
|
$this->messages->error(trans('visiosoft.module.cats::message.cat_slug_exists', [
|
||||||
'slug' => $slug
|
'slug' => $slug
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user