From 26d5d14ef4700a6afe454e396dfc0ac289937b7b Mon Sep 17 00:00:00 2001 From: jitendra Date: Thu, 27 Oct 2022 16:48:06 +0530 Subject: [PATCH] Fixed issues --- composer.json | 1 + composer.lock | 56 ++++++++++++++++++- .../Product/src/Helpers/AbstractProduct.php | 0 .../Indexers/ElasticSearch/Product.php | 2 +- .../Repositories/ElasticSearchRepository.php | 4 +- 5 files changed, 59 insertions(+), 4 deletions(-) mode change 100755 => 100644 packages/Webkul/Product/src/Helpers/AbstractProduct.php diff --git a/composer.json b/composer.json index fbf16000b..4483dd02f 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ "require": { "php": "^8.1", "astrotomic/laravel-translatable": "^11.0.0", + "bagisto/laravel-datafaker": "^2.0@alpha", "bagisto/rest-api": "^1.0", "bagistobrasil/bagisto-product-social-share": "^0.1.2", "barryvdh/laravel-debugbar": "^3.1", diff --git a/composer.lock b/composer.lock index 94994a70e..6cfd58e84 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6e26b3b441dbf0a0242f4fe0b3800ef0", + "content-hash": "f97b453abb0e5218dd71c940aaa63d00", "packages": [ { "name": "astrotomic/laravel-translatable", @@ -97,6 +97,59 @@ ], "time": "2022-02-05T10:42:52+00:00" }, + { + "name": "bagisto/laravel-datafaker", + "version": "v2.0.0-ALPHA1", + "source": { + "type": "git", + "url": "https://github.com/bagisto/laravel-data-faker.git", + "reference": "09c3587a6cef80e84ddc16ea30cd2f0ade1d09b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bagisto/laravel-data-faker/zipball/09c3587a6cef80e84ddc16ea30cd2f0ade1d09b2", + "reference": "09c3587a6cef80e84ddc16ea30cd2f0ade1d09b2", + "shasum": "" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Webkul\\Faker\\Providers\\FakerServiceProvider" + ], + "aliases": [] + } + }, + "autoload": { + "psr-4": { + "Webkul\\Faker\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jitendra Singh", + "email": "jitendra@webkul.in", + "homepage": "https://bagisto.com" + } + ], + "description": "Create fake customers, categories and products in Bagisto.", + "homepage": "https://github.com/bagisto/laravel-data-faker", + "keywords": [ + "bagisto", + "fake categories", + "fake customers", + "fake products" + ], + "support": { + "issues": "https://github.com/bagisto/laravel-data-faker/issues", + "source": "https://github.com/bagisto/laravel-data-faker/tree/v2.0.0-ALPHA1" + }, + "time": "2022-10-14T10:10:16+00:00" + }, { "name": "bagisto/rest-api", "version": "v1.0.0", @@ -12616,6 +12669,7 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { + "bagisto/laravel-datafaker": 15, "flynsarmy/db-blade-compiler": 20, "codeception/codeception": 20, "codeception/module-laravel": 20 diff --git a/packages/Webkul/Product/src/Helpers/AbstractProduct.php b/packages/Webkul/Product/src/Helpers/AbstractProduct.php old mode 100755 new mode 100644 diff --git a/packages/Webkul/Product/src/Helpers/Indexers/ElasticSearch/Product.php b/packages/Webkul/Product/src/Helpers/Indexers/ElasticSearch/Product.php index bc45e7422..4e762e166 100644 --- a/packages/Webkul/Product/src/Helpers/Indexers/ElasticSearch/Product.php +++ b/packages/Webkul/Product/src/Helpers/Indexers/ElasticSearch/Product.php @@ -114,7 +114,7 @@ class Product ]; try { - \Elasticsearch::delete($params); + Elasticsearch::delete($params); } catch(\Exception $e) {} return; diff --git a/packages/Webkul/Product/src/Repositories/ElasticSearchRepository.php b/packages/Webkul/Product/src/Repositories/ElasticSearchRepository.php index 3b1a1e79d..61360606f 100755 --- a/packages/Webkul/Product/src/Repositories/ElasticSearchRepository.php +++ b/packages/Webkul/Product/src/Repositories/ElasticSearchRepository.php @@ -53,7 +53,7 @@ class ElasticSearchRepository 'size' => $options['limit'], 'stored_fields' => [], 'query' => [ - 'bool' => $filters, + 'bool' => $filters ?: new \stdClass(), ], 'sort' => $this->getSortOptions($options), ], @@ -144,7 +144,7 @@ class ElasticSearchRepository /** * Returns sort options * - * @parmas array $options + * @param array $options * @return array */ public function getSortOptions($options)