File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder
lib/internal/Magento/Framework Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ public function getSort(RequestInterface $request)
9292 if (in_array ($ item ['field ' ], $ this ->skippedFields )) {
9393 continue ;
9494 }
95- $ attribute = $ this ->attributeAdapterProvider ->getByAttributeCode ($ item ['field ' ]);
95+ $ attribute = $ this ->attributeAdapterProvider ->getByAttributeCode (( string ) $ item ['field ' ]);
9696 $ fieldName = $ this ->fieldNameResolver ->getFieldName ($ attribute );
9797 if (isset ($ this ->map [$ fieldName ])) {
9898 $ fieldName = $ this ->map [$ fieldName ];
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ public function unsetData($key = null)
120120 * @param string $key
121121 * @param string|int $index
122122 * @return mixed
123+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
123124 */
124125 public function getData ($ key = '' , $ index = null )
125126 {
@@ -128,7 +129,7 @@ public function getData($key = '', $index = null)
128129 }
129130
130131 /* process a/b/c key as ['a']['b']['c'] */
131- if (strpos (( string ) $ key , '/ ' ) !== false ) {
132+ if ($ key !== null && strpos ($ key , '/ ' ) !== false ) {
132133 $ data = $ this ->getDataByPath ($ key );
133134 } else {
134135 $ data = $ this ->_getData ($ key );
You can’t perform that action at this time.
0 commit comments