mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#2817 slug error fixed
This commit is contained in:
parent
e9f3ec232b
commit
8275be050a
@ -216,8 +216,15 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
||||
|
||||
public function getAdvDetailLinkByModel($object, $type = null)
|
||||
{
|
||||
$id = $object->id;
|
||||
$seo = str_slug($object->slug, '-');
|
||||
if ($type != null) {
|
||||
$id = $object->id;
|
||||
$seo = str_slug($object->name);
|
||||
$seo = str_replace('_', '-', $seo);
|
||||
return \route('adv_detail_seo', [$seo, $id]);
|
||||
}
|
||||
$id = $object->getObject()->id;
|
||||
$seo = str_slug($object->getObject()->name);
|
||||
$seo = str_replace('_', '-', $seo);
|
||||
return \route('adv_detail_seo', [$seo, $id]);
|
||||
}
|
||||
|
||||
|
||||
@ -581,10 +581,7 @@ class AdvsController extends PublicController
|
||||
$configurations = $this->optionConfigurationRepository->getConf($adv->id);
|
||||
|
||||
|
||||
if (Str::slug($adv->slug, '-') != $seo) {
|
||||
$this->messages->error(trans('visiosoft.module.advs::message.ad_doesnt_exist'));
|
||||
return redirect()->route('visiosoft.module.advs::list');
|
||||
} else if ($adv->created_by_id == isset(auth()->user()->id) or $adv->status == "approved") {
|
||||
if ($adv->created_by_id == isset(auth()->user()->id) or $adv->status == "approved") {
|
||||
return $this->view->make('visiosoft.module.advs::ad-detail/detail', compact('adv', 'complaints',
|
||||
'recommended_advs', 'categories', 'features', 'options', 'configurations'));
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user