Merge pull request #1194 from openclassify/navigation

ads edit error
This commit is contained in:
Dia Shalabi 2021-10-07 17:27:16 +03:00 committed by GitHub
commit 9ed60aff53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -62,12 +62,11 @@ 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;
}
return 1;
}
public function priceFormat($adv)

View File

@ -13,9 +13,10 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface
public function getIconUrlAttribute()
{
return $this->dispatch(
new MakeImageInstance($this->icon ?? 'visiosoft.module.advs::images/listing/sample-cat-icon.svg', 'img')
)->url();
if ($this->icon === null) {
return $this->dispatch(new MakeImageInstance('visiosoft.module.advs::images/listing/sample-cat-icon.svg', 'img'))->url();
}
return $this->icon;
}
public function getCat($id)