Fixes for PHP 7.4 and Pyrocms 3.8

This commit is contained in:
Fatih Alp 2021-01-04 00:31:56 +03:00
parent 6300c06736
commit a229c6bec0
7 changed files with 7 additions and 27 deletions

View File

@ -78,8 +78,7 @@ class AdvTableBuilder extends TableBuilder
protected $options = [ protected $options = [
'order_by' => [ 'order_by' => [
'id' => 'DESC', 'id' => 'DESC',
], ]
'table_view' => 'visiosoft.module.advs::admin/table/table'
]; ];
/** /**

View File

@ -23,7 +23,6 @@ use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
use Visiosoft\AdvsModule\OptionConfiguration\Contract\OptionConfigurationRepositoryInterface; use Visiosoft\AdvsModule\OptionConfiguration\Contract\OptionConfigurationRepositoryInterface;
use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface; use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface;
use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface; use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface;
use Visiosoft\AlgoliaModule\Search\SearchModel;
use Visiosoft\CatsModule\Category\CategoryModel; use Visiosoft\CatsModule\Category\CategoryModel;
use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface; use Visiosoft\CatsModule\Category\Contract\CategoryRepositoryInterface;
use Visiosoft\CloudinaryModule\Video\VideoModel; use Visiosoft\CloudinaryModule\Video\VideoModel;
@ -257,7 +256,7 @@ class AdvsController extends PublicController
$advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list'); $advs[$index]->detail_url = $this->adv_model->getAdvDetailLinkByModel($ad, 'list');
$advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad); $advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
} }
$seenList = array();
if ($isActiveCustomFields) { if ($isActiveCustomFields) {
$cfRepository = app('Visiosoft\CustomfieldsModule\CustomField\CustomFieldRepository'); $cfRepository = app('Visiosoft\CustomfieldsModule\CustomField\CustomFieldRepository');
@ -286,7 +285,8 @@ class AdvsController extends PublicController
$allCats = true; $allCats = true;
} }
$cFArray = array(); $cFArray = $checkboxes = $topfields = $selectDropdown = $selectRange = $selectImage = $ranges = $radio = array();
if ($isActiveCustomFields) { if ($isActiveCustomFields) {
$returnvalues = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->index($mainCats, $subCats); $returnvalues = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->index($mainCats, $subCats);
$checkboxes = $returnvalues['checkboxes']; $checkboxes = $returnvalues['checkboxes'];
@ -785,16 +785,6 @@ class AdvsController extends PublicController
$adv->is_get_adv = $request->is_get_adv; $adv->is_get_adv = $request->is_get_adv;
$adv->save(); $adv->save();
//algolia Search Module
$isActiveAlgolia = $advModel->is_enabled('algolia');
if ($isActiveAlgolia) {
$algolia = new SearchModel();
if ($adv->slug == "") {
$algolia->saveAlgolia($adv->toArray(), $settings);
} else {
$algolia->updateAlgolia($request->toArray(), $settings);
}
}
//Cloudinary Module //Cloudinary Module
$isActiveCloudinary = $advModel->is_enabled('cloudinary'); $isActiveCloudinary = $advModel->is_enabled('cloudinary');
if ($isActiveCloudinary) { if ($isActiveCloudinary) {
@ -884,6 +874,7 @@ class AdvsController extends PublicController
->packageAddCart(\request()->pack_id, $new->id); ->packageAddCart(\request()->pack_id, $new->id);
} }
} }
$events->dispatch(new EditAd($advModel));
return redirect('/advs/edit_advs/' . $new->id); return redirect('/advs/edit_advs/' . $new->id);
} }
@ -975,12 +966,6 @@ class AdvsController extends PublicController
} }
} }
$isActiveAlgolia = $this->adv_model->is_enabled('algolia');
if ($isActiveAlgolia) {
$algolia = new SearchModel();
$algolia->updateStatus($id, $type, $settings);
}
$this->adv_model->statusAds($id, $type); $this->adv_model->statusAds($id, $type);
event(new ChangedStatusAd($ad));//Create Notify event(new ChangedStatusAd($ad));//Create Notify
if ($type === 'approved') { if ($type === 'approved') {

View File

@ -7,7 +7,6 @@
<a href="{{ url_route('adv_list_seo', [main_category.slug]) }}" class="main-category"> <a href="{{ url_route('adv_list_seo', [main_category.slug]) }}" class="main-category">
<b>{{ main_category.name }}</b> <b>{{ main_category.name }}</b>
{% if showAdsCount %} {% if showAdsCount %}
{% set catAdsCount = entries('advs', 'advs').countAdsByCategoryId(main_category.id) %}
<small class="text-muted"> <small class="text-muted">
({{ catAdsCount }}) ({{ catAdsCount }})
</small> </small>
@ -33,7 +32,6 @@
<a href="{{ url_route('adv_list_seo', [sub_category.slug]) }}">{{ sub_category.name }}</a> <a href="{{ url_route('adv_list_seo', [sub_category.slug]) }}">{{ sub_category.name }}</a>
{% if showAdsCount %} {% if showAdsCount %}
{% set catLevel = getParentsCount(sub_category.id) + 1 %} {% set catLevel = getParentsCount(sub_category.id) + 1 %}
{% set catAdsCount = entries('advs', 'advs').countAdsByCategoryId(sub_category.id, catLevel) %}
<small class="text-muted"> <small class="text-muted">
({{ catAdsCount }}) ({{ catAdsCount }})
</small> </small>

View File

@ -80,7 +80,7 @@ class CategoryTableBuilder extends TableBuilder
* @var array * @var array
*/ */
protected $options = [ protected $options = [
'table_view' => 'visiosoft.module.cats::table.table'
]; ];
/** /**

View File

@ -96,7 +96,6 @@ class ValueTableBuilder extends TableBuilder
'limit' => 9999, 'limit' => 9999,
'show_headers' => false, 'show_headers' => false,
'sortable_headers' => false, 'sortable_headers' => false,
'table_view' => 'visiosoft.field_type.media::table/table',
'no_results_message' => 'visiosoft.field_type.media::message.no_files_selected', 'no_results_message' => 'visiosoft.field_type.media::message.no_files_selected',
]; ];

View File

@ -63,7 +63,6 @@ class ValueTableBuilder extends TableBuilder
'limit' => 1, 'limit' => 1,
'show_headers' => false, 'show_headers' => false,
'sortable_headers' => false, 'sortable_headers' => false,
'table_view' => 'visiosoft.field_type.singlefile::table',
'no_results_message' => 'visiosoft.field_type.singlefile::message.no_file_selected', 'no_results_message' => 'visiosoft.field_type.singlefile::message.no_file_selected',
]; ];