From 8f02472331ec794445b2143f20a47faf3cd854c7 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Fri, 13 Nov 2020 13:36:35 +0300 Subject: [PATCH 1/6] =?UTF-8?q?#2647=20emlak24=20yap=C4=B1lacaklar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Http/Controller/AjaxController.php | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php index 0ac30691e..89f057d97 100644 --- a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php +++ b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php @@ -1,6 +1,7 @@ country_model = $countryModel; $this->city_model = $cityModel; @@ -48,6 +55,7 @@ class AjaxController extends PublicController $this->neighborhood_model = $neighborhoodModel; $this->village_model = $villageModel; parent::__construct(); + $this->citiesEntryTranslationsModel = $citiesEntryTranslationsModel; } /** @@ -72,6 +80,21 @@ class AjaxController extends PublicController $id = explode(',', $this->request->id); $query = $this->city_model->whereIn('parent_country_id', $id); + if (request()->order_by && $this->city_model->isTranslatedAttribute(request()->order_by)) { + return $this->citiesEntryTranslationsModel->newQuery() + ->select('entry_id as id', 'name') + ->whereIn('locale', [ + Request()->session()->get('_locale'), + setting_value('streams::default_locale'), + 'en' + ]) + ->whereIn('entry_id', $query->pluck('id')->all()) + ->orderBy(request()->order_by) + ->get(); + } elseif ($orderBy = request()->order_by) { + return $this->queryOrder($query, $orderBy); + } + return $this->queryOrder($query); } } @@ -133,10 +156,10 @@ class AjaxController extends PublicController } } - public function queryOrder($query) + public function queryOrder($query, $orderBy = null) { $sorting_type = setting_value('visiosoft.module.location::sorting_type'); - $sorting_column = setting_value('visiosoft.module.location::sorting_column'); + $sorting_column = $orderBy ?: setting_value('visiosoft.module.location::sorting_column'); return $query->orderBy($sorting_column, $sorting_type)->get(); } From 4a25e7834ad5f79777a2b63e470b306976a843b6 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Fri, 13 Nov 2020 13:44:28 +0300 Subject: [PATCH 2/6] =?UTF-8?q?#2647=20emlak24=20yap=C4=B1lacaklar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/City/CityRepository.php | 23 ++++++- .../City/Contract/CityRepositoryInterface.php | 2 + .../src/Http/Controller/AjaxController.php | 62 +++---------------- 3 files changed, 34 insertions(+), 53 deletions(-) diff --git a/addons/default/visiosoft/location-module/src/City/CityRepository.php b/addons/default/visiosoft/location-module/src/City/CityRepository.php index 02350097f..9a1fd8147 100644 --- a/addons/default/visiosoft/location-module/src/City/CityRepository.php +++ b/addons/default/visiosoft/location-module/src/City/CityRepository.php @@ -1,5 +1,6 @@ model = $model; + $this->citiesEntryTranslationsModel = $citiesEntryTranslationsModel; } public function findById($id) { return $this->model->orderBy('created_at', 'DESC')->where('location_cities.id', $id)->first(); } + + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy) + { + return $this->citiesEntryTranslationsModel->newQuery() + ->select('entry_id as id', 'name') + ->whereIn('locale', [ + Request()->session()->get('_locale'), + setting_value('streams::default_locale'), + 'en' + ]) + ->whereIn('entry_id', $entryIDs) + ->orderBy($orderBy) + ->get(); + } } diff --git a/addons/default/visiosoft/location-module/src/City/Contract/CityRepositoryInterface.php b/addons/default/visiosoft/location-module/src/City/Contract/CityRepositoryInterface.php index 78f8e25c6..7b4f3520d 100644 --- a/addons/default/visiosoft/location-module/src/City/Contract/CityRepositoryInterface.php +++ b/addons/default/visiosoft/location-module/src/City/Contract/CityRepositoryInterface.php @@ -5,4 +5,6 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface; interface CityRepositoryInterface extends EntryRepositoryInterface { public function findById($id); + + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy); } diff --git a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php index 89f057d97..ceedd10b7 100644 --- a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php +++ b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php @@ -3,6 +3,7 @@ use Anomaly\Streams\Platform\Http\Controller\PublicController; use Anomaly\Streams\Platform\Model\Location\LocationCitiesEntryTranslationsModel; use Visiosoft\LocationModule\City\CityModel; +use Visiosoft\LocationModule\City\Contract\CityRepositoryInterface; use Visiosoft\LocationModule\Country\CountryModel; use Visiosoft\LocationModule\District\DistrictModel; use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel; @@ -11,56 +12,34 @@ use Illuminate\Support\Str; class AjaxController extends PublicController { - /** - * @var CountryModel - */ private $country_model; - /** - * @var CityModel - */ private $city_model; - /** - * @var DistrictModel - */ private $district_model; - /** - * @var NeighborhoodModel - */ private $neighborhood_model; - /** - * @var VillageModel - */ private $village_model; - /** - * @var LocationCitiesEntryTranslationsModel - */ private $citiesEntryTranslationsModel; + private $cityRepository; - /** - * AjaxController constructor. - * @param CountryModel $countryModel - */ public function __construct( CountryModel $countryModel, CityModel $cityModel, DistrictModel $districtModel, NeighborhoodModel $neighborhoodModel, VillageModel $villageModel, - LocationCitiesEntryTranslationsModel $citiesEntryTranslationsModel + LocationCitiesEntryTranslationsModel $citiesEntryTranslationsModel, + CityRepositoryInterface $cityRepository ) { + parent::__construct(); $this->country_model = $countryModel; $this->city_model = $cityModel; $this->district_model = $districtModel; $this->neighborhood_model = $neighborhoodModel; $this->village_model = $villageModel; - parent::__construct(); $this->citiesEntryTranslationsModel = $citiesEntryTranslationsModel; + $this->cityRepository = $cityRepository; } - /** - * @return mixed - */ public function getCountries() { if ($this->request->id) @@ -71,9 +50,6 @@ class AjaxController extends PublicController } } - /** - * @return mixed - */ public function getCities() { if ($this->request->id) { @@ -81,16 +57,10 @@ class AjaxController extends PublicController $query = $this->city_model->whereIn('parent_country_id', $id); if (request()->order_by && $this->city_model->isTranslatedAttribute(request()->order_by)) { - return $this->citiesEntryTranslationsModel->newQuery() - ->select('entry_id as id', 'name') - ->whereIn('locale', [ - Request()->session()->get('_locale'), - setting_value('streams::default_locale'), - 'en' - ]) - ->whereIn('entry_id', $query->pluck('id')->all()) - ->orderBy(request()->order_by) - ->get(); + return $this->cityRepository->getByEntryIDsAndOrderByTransCol( + $query->pluck('id')->all(), + request()->order_by + ); } elseif ($orderBy = request()->order_by) { return $this->queryOrder($query, $orderBy); } @@ -99,9 +69,6 @@ class AjaxController extends PublicController } } - /** - * @return mixed - */ public function getDistricts() { if ($this->request->id) { @@ -113,9 +80,6 @@ class AjaxController extends PublicController } } - /** - * @return mixed - */ public function getNeighborhoods() { if ($this->request->id) { @@ -127,9 +91,6 @@ class AjaxController extends PublicController } } - /** - * @return mixed - */ public function getVillage() { if ($this->request->id) { @@ -141,9 +102,6 @@ class AjaxController extends PublicController } } - /** - * @return mixed - */ public function getCity() { if ($this->request->name) { From 4cb3254dc61d2c44d055319e67b3cf67a648e32f Mon Sep 17 00:00:00 2001 From: Diatrex Date: Sat, 14 Nov 2020 10:15:07 +0300 Subject: [PATCH 3/6] #2622 ad list filter by user error --- .../advs-module/src/Http/Controller/advsController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php index 5c1db1afd..f46783a6e 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/advsController.php @@ -436,9 +436,10 @@ class AdvsController extends PublicController $user = null; if (\request()->user) { - $user = $this->userRepository->find(\request()->user); - $showTitle = false; - $metaTitle = $user->name() . ' ' . trans('visiosoft.module.advs::field.ads'); + if ($user = $this->userRepository->find(\request()->user)) { + $showTitle = false; + $metaTitle = $user->name() . ' ' . trans('visiosoft.module.advs::field.ads'); + } } $this->template->set('showTitle', $showTitle); From db956ca7e004748c2cb12738a0584bfd023e6ba8 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Sat, 14 Nov 2020 10:41:40 +0300 Subject: [PATCH 4/6] changes --- .../location-module/resources/config/settings/settings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/default/visiosoft/location-module/resources/config/settings/settings.php b/addons/default/visiosoft/location-module/resources/config/settings/settings.php index cc295bd84..e3c06b3c8 100644 --- a/addons/default/visiosoft/location-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/location-module/resources/config/settings/settings.php @@ -94,7 +94,8 @@ return [ 'options' => [ 'slug' => 'slug', 'id' => 'id', - 'order' => 'order' + 'order' => 'order', + 'name' => 'name', ], ], ], From cb407b380b669358f75de5f0c844c3b769cfbaa8 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Sat, 14 Nov 2020 11:07:07 +0300 Subject: [PATCH 5/6] store --- .../src/City/CityRepository.php | 4 +- .../City/Contract/CityRepositoryInterface.php | 2 +- .../Contract/CountryRepositoryInterface.php | 2 + .../src/Country/CountryRepository.php | 26 +++++- .../Contract/DistrictRepositoryInterface.php | 2 +- .../src/District/DistrictRepository.php | 26 +++++- .../src/Http/Controller/AjaxController.php | 87 +++++++++---------- .../NeighborhoodRepositoryInterface.php | 2 +- .../Neighborhood/NeighborhoodRepository.php | 26 +++++- .../Contract/VillageRepositoryInterface.php | 2 +- .../src/Village/VillageRepository.php | 26 +++++- 11 files changed, 147 insertions(+), 58 deletions(-) diff --git a/addons/default/visiosoft/location-module/src/City/CityRepository.php b/addons/default/visiosoft/location-module/src/City/CityRepository.php index 9a1fd8147..26c711983 100644 --- a/addons/default/visiosoft/location-module/src/City/CityRepository.php +++ b/addons/default/visiosoft/location-module/src/City/CityRepository.php @@ -35,7 +35,7 @@ class CityRepository extends EntryRepository implements CityRepositoryInterface return $this->model->orderBy('created_at', 'DESC')->where('location_cities.id', $id)->first(); } - public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy) + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc') { return $this->citiesEntryTranslationsModel->newQuery() ->select('entry_id as id', 'name') @@ -45,7 +45,7 @@ class CityRepository extends EntryRepository implements CityRepositoryInterface 'en' ]) ->whereIn('entry_id', $entryIDs) - ->orderBy($orderBy) + ->orderBy($orderBy, $direction) ->get(); } } diff --git a/addons/default/visiosoft/location-module/src/City/Contract/CityRepositoryInterface.php b/addons/default/visiosoft/location-module/src/City/Contract/CityRepositoryInterface.php index 7b4f3520d..2e8993d9d 100644 --- a/addons/default/visiosoft/location-module/src/City/Contract/CityRepositoryInterface.php +++ b/addons/default/visiosoft/location-module/src/City/Contract/CityRepositoryInterface.php @@ -6,5 +6,5 @@ interface CityRepositoryInterface extends EntryRepositoryInterface { public function findById($id); - public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy); + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc'); } diff --git a/addons/default/visiosoft/location-module/src/Country/Contract/CountryRepositoryInterface.php b/addons/default/visiosoft/location-module/src/Country/Contract/CountryRepositoryInterface.php index 6bdc2fed1..b4659e6ac 100644 --- a/addons/default/visiosoft/location-module/src/Country/Contract/CountryRepositoryInterface.php +++ b/addons/default/visiosoft/location-module/src/Country/Contract/CountryRepositoryInterface.php @@ -7,4 +7,6 @@ interface CountryRepositoryInterface extends EntryRepositoryInterface public function findById($id); public function viewAll(); + + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc'); } diff --git a/addons/default/visiosoft/location-module/src/Country/CountryRepository.php b/addons/default/visiosoft/location-module/src/Country/CountryRepository.php index dd1f6d455..a8a25a6e2 100644 --- a/addons/default/visiosoft/location-module/src/Country/CountryRepository.php +++ b/addons/default/visiosoft/location-module/src/Country/CountryRepository.php @@ -1,5 +1,6 @@ model = $model; + $this->countriesEntryTranslationsModel = $countriesEntryTranslationsModel; } public function findById($id) { @@ -30,4 +40,18 @@ class CountryRepository extends EntryRepository implements CountryRepositoryInte public function viewAll(){ return $this->model->get(); } + + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc') + { + return $this->countriesEntryTranslationsModel->newQuery() + ->select('entry_id as id', 'name') + ->whereIn('locale', [ + Request()->session()->get('_locale'), + setting_value('streams::default_locale'), + 'en' + ]) + ->whereIn('entry_id', $entryIDs) + ->orderBy($orderBy, $direction) + ->get(); + } } diff --git a/addons/default/visiosoft/location-module/src/District/Contract/DistrictRepositoryInterface.php b/addons/default/visiosoft/location-module/src/District/Contract/DistrictRepositoryInterface.php index 40f36e204..465cb1a16 100644 --- a/addons/default/visiosoft/location-module/src/District/Contract/DistrictRepositoryInterface.php +++ b/addons/default/visiosoft/location-module/src/District/Contract/DistrictRepositoryInterface.php @@ -4,5 +4,5 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface; interface DistrictRepositoryInterface extends EntryRepositoryInterface { - + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc'); } diff --git a/addons/default/visiosoft/location-module/src/District/DistrictRepository.php b/addons/default/visiosoft/location-module/src/District/DistrictRepository.php index e84861e8d..3790d78f9 100644 --- a/addons/default/visiosoft/location-module/src/District/DistrictRepository.php +++ b/addons/default/visiosoft/location-module/src/District/DistrictRepository.php @@ -1,5 +1,6 @@ model = $model; + $this->districtsEntryTranslationsModel = $districtsEntryTranslationsModel; + } + + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc') + { + return $this->districtsEntryTranslationsModel->newQuery() + ->select('entry_id as id', 'name') + ->whereIn('locale', [ + Request()->session()->get('_locale'), + setting_value('streams::default_locale'), + 'en' + ]) + ->whereIn('entry_id', $entryIDs) + ->orderBy($orderBy, $direction) + ->get(); } } diff --git a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php index ceedd10b7..09f26662d 100644 --- a/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php +++ b/addons/default/visiosoft/location-module/src/Http/Controller/AjaxController.php @@ -1,52 +1,44 @@ country_model = $countryModel; - $this->city_model = $cityModel; - $this->district_model = $districtModel; - $this->neighborhood_model = $neighborhoodModel; - $this->village_model = $villageModel; - $this->citiesEntryTranslationsModel = $citiesEntryTranslationsModel; $this->cityRepository = $cityRepository; + $this->countryRepository = $countryRepository; + $this->districtRepository = $districtRepository; + $this->neighborhoodRepository = $neighborhoodRepository; + $this->villageRepository = $villageRepository; } public function getCountries() { if ($this->request->id) - return $this->country_model->find($this->request->id); + return $this->countryRepository->getModel()->find($this->request->id); else { - $query = $this->country_model; - return $this->queryOrder($query); + $query = $this->countryRepository->getModel(); + return $this->queryOrder($query, $this->countryRepository); } } @@ -54,18 +46,9 @@ class AjaxController extends PublicController { if ($this->request->id) { $id = explode(',', $this->request->id); - $query = $this->city_model->whereIn('parent_country_id', $id); + $query = $this->cityRepository->getModel()->whereIn('parent_country_id', $id); - if (request()->order_by && $this->city_model->isTranslatedAttribute(request()->order_by)) { - return $this->cityRepository->getByEntryIDsAndOrderByTransCol( - $query->pluck('id')->all(), - request()->order_by - ); - } elseif ($orderBy = request()->order_by) { - return $this->queryOrder($query, $orderBy); - } - - return $this->queryOrder($query); + return $this->queryOrder($query, $this->cityRepository); } } @@ -74,9 +57,9 @@ class AjaxController extends PublicController if ($this->request->id) { $id = explode(',', $this->request->id); - $query = $this->district_model->whereIn('parent_city_id', $id); + $query = $this->districtRepository->getModel()->whereIn('parent_city_id', $id); - return $this->queryOrder($query); + return $this->queryOrder($query, $this->districtRepository); } } @@ -85,9 +68,9 @@ class AjaxController extends PublicController if ($this->request->id) { $id = explode(',', $this->request->id); - $query = $this->neighborhood_model->whereIn('parent_district_id', $id); + $query = $this->neighborhoodRepository->getModel()->whereIn('parent_district_id', $id); - return $this->queryOrder($query); + return $this->queryOrder($query, $this->neighborhoodRepository); } } @@ -96,9 +79,9 @@ class AjaxController extends PublicController if ($this->request->id) { $id = explode(',', $this->request->id); - $query = $this->village_model->whereIn('parent_neighborhood_id', $id); + $query = $this->villageRepository->getModel()->whereIn('parent_neighborhood_id', $id); - return $this->queryOrder($query); + return $this->queryOrder($query, $this->villageRepository); } } @@ -106,7 +89,7 @@ class AjaxController extends PublicController { if ($this->request->name) { $slug = Str::slug($this->request->name, '_'); - if ($city = $this->city_model->newQuery()->where('slug', 'LIKE', $slug . '%')->first()) { + if ($city = $this->cityRepository->getModel()->newQuery()->where('slug', 'LIKE', $slug . '%')->first()) { return ['success' => true, 'city' => $city]; } else { return ['success' => false]; @@ -114,10 +97,18 @@ class AjaxController extends PublicController } } - public function queryOrder($query, $orderBy = null) + public function queryOrder($query, $repository) { $sorting_type = setting_value('visiosoft.module.location::sorting_type'); - $sorting_column = $orderBy ?: setting_value('visiosoft.module.location::sorting_column'); + $sorting_column = setting_value('visiosoft.module.location::sorting_column'); + + if ($repository->getModel()->isTranslatedAttribute($sorting_column)) { + return $repository->getByEntryIDsAndOrderByTransCol( + $query->pluck('id')->all(), + $sorting_column, + $sorting_type + ); + } return $query->orderBy($sorting_column, $sorting_type)->get(); } diff --git a/addons/default/visiosoft/location-module/src/Neighborhood/Contract/NeighborhoodRepositoryInterface.php b/addons/default/visiosoft/location-module/src/Neighborhood/Contract/NeighborhoodRepositoryInterface.php index f5f46fc69..f1dceaf15 100644 --- a/addons/default/visiosoft/location-module/src/Neighborhood/Contract/NeighborhoodRepositoryInterface.php +++ b/addons/default/visiosoft/location-module/src/Neighborhood/Contract/NeighborhoodRepositoryInterface.php @@ -4,5 +4,5 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface; interface NeighborhoodRepositoryInterface extends EntryRepositoryInterface { - + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc'); } diff --git a/addons/default/visiosoft/location-module/src/Neighborhood/NeighborhoodRepository.php b/addons/default/visiosoft/location-module/src/Neighborhood/NeighborhoodRepository.php index c4d91bcba..75023993e 100644 --- a/addons/default/visiosoft/location-module/src/Neighborhood/NeighborhoodRepository.php +++ b/addons/default/visiosoft/location-module/src/Neighborhood/NeighborhoodRepository.php @@ -1,5 +1,6 @@ model = $model; + $this->neighborhoodsEntryTranslationsModel = $neighborhoodsEntryTranslationsModel; + } + + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc') + { + return $this->neighborhoodsEntryTranslationsModel->newQuery() + ->select('entry_id as id', 'name') + ->whereIn('locale', [ + Request()->session()->get('_locale'), + setting_value('streams::default_locale'), + 'en' + ]) + ->whereIn('entry_id', $entryIDs) + ->orderBy($orderBy, $direction) + ->get(); } } diff --git a/addons/default/visiosoft/location-module/src/Village/Contract/VillageRepositoryInterface.php b/addons/default/visiosoft/location-module/src/Village/Contract/VillageRepositoryInterface.php index 3b386057f..65f259fdf 100644 --- a/addons/default/visiosoft/location-module/src/Village/Contract/VillageRepositoryInterface.php +++ b/addons/default/visiosoft/location-module/src/Village/Contract/VillageRepositoryInterface.php @@ -4,5 +4,5 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface; interface VillageRepositoryInterface extends EntryRepositoryInterface { - + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc'); } diff --git a/addons/default/visiosoft/location-module/src/Village/VillageRepository.php b/addons/default/visiosoft/location-module/src/Village/VillageRepository.php index 15dc0fc1a..4f7d64d9b 100644 --- a/addons/default/visiosoft/location-module/src/Village/VillageRepository.php +++ b/addons/default/visiosoft/location-module/src/Village/VillageRepository.php @@ -1,5 +1,6 @@ model = $model; + $this->villageEntryTranslationsModel = $villageEntryTranslationsModel; + } + + public function getByEntryIDsAndOrderByTransCol($entryIDs, $orderBy, $direction = 'asc') + { + return $this->villageEntryTranslationsModel->newQuery() + ->select('entry_id as id', 'name') + ->whereIn('locale', [ + Request()->session()->get('_locale'), + setting_value('streams::default_locale'), + 'en' + ]) + ->whereIn('entry_id', $entryIDs) + ->orderBy($orderBy, $direction) + ->get(); } } From 503add2963ea5113bd4593872b5cf887682dffc7 Mon Sep 17 00:00:00 2001 From: Diatrex Date: Sat, 14 Nov 2020 11:36:28 +0300 Subject: [PATCH 6/6] #2609 ad detail error when store not installed --- addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php b/addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php index 1f0aaa106..38b99bb8f 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvPresenter.php @@ -62,7 +62,7 @@ class AdvPresenter extends EntryPresenter public function isCorporate() { $user_id = $this->getObject()->created_by; - if ($user_id->register_type != null) { + if ($user_id && $user_id->register_type != null) { return $user_id->register_type; } else { return 1;