mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#2609 ad detail error when store not installed
This commit is contained in:
parent
7deba2ab1a
commit
50f371896b
@ -26,4 +26,5 @@ return [
|
||||
'replicated_success' => 'The ad has been replicated successfully!',
|
||||
'ad_doesnt_exist' => "This ad doesn't exist!",
|
||||
'select_location_error' => "Please select a location on the map!",
|
||||
'this_ad_is_not_valid_anymore' => "This ad is not valid anymore!",
|
||||
];
|
||||
|
||||
@ -62,7 +62,7 @@ class AdvPresenter extends EntryPresenter
|
||||
public function isCorporate()
|
||||
{
|
||||
$user_id = $this->getObject()->created_by;
|
||||
if ($user_id && $user_id->register_type != null) {
|
||||
if ($user_id->register_type != null) {
|
||||
return $user_id->register_type;
|
||||
} else {
|
||||
return 1;
|
||||
|
||||
@ -485,6 +485,11 @@ class AdvsController extends PublicController
|
||||
$adv = $this->adv_repository->getListItemAdv($id);
|
||||
|
||||
if ($adv && (!$adv->expired() || $adv->created_by_id === \auth()->id())) {
|
||||
// Check if created by exists
|
||||
if (!$adv->created_by) {
|
||||
$this->messages->error('visiosoft.module.advs::message.this_ad_is_not_valid_anymore');
|
||||
return $this->redirect->route('visiosoft.module.advs::list');
|
||||
}
|
||||
|
||||
if ($this->adv_model->is_enabled('complaints')) {
|
||||
$complaints = ComplaintsComplainTypesEntryModel::all();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user