File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/code/Magento/Elasticsearch/Model/Advanced Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 9
9
use Magento \Catalog \Model \Product \Visibility ;
10
10
use Magento \Catalog \Model \ResourceModel \Product \Collection ;
11
11
use Magento \CatalogSearch \Model \Advanced \ProductCollectionPrepareStrategyInterface ;
12
+ use Magento \Framework \App \ObjectManager ;
12
13
13
14
/**
14
15
* Strategy interface for preparing product collection.
@@ -27,14 +28,15 @@ class ProductCollectionPrepareStrategy implements ProductCollectionPrepareStrate
27
28
28
29
/**
29
30
* @param Config $catalogConfig
30
- * @param Visibility $catalogProductVisibility
31
+ * @param Visibility|null $catalogProductVisibility
31
32
*/
32
33
public function __construct (
33
34
Config $ catalogConfig ,
34
- Visibility $ catalogProductVisibility
35
+ Visibility $ catalogProductVisibility = null
35
36
) {
36
37
$ this ->catalogConfig = $ catalogConfig ;
37
- $ this ->catalogProductVisibility = $ catalogProductVisibility ;
38
+ $ this ->catalogProductVisibility = $ catalogProductVisibility
39
+ ?? ObjectManager::getInstance ()->get (Visibility::class);;
38
40
}
39
41
40
42
/**
You can’t perform that action at this time.
0 commit comments