File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ protected function _getLoadByIdentifierSelect($identifier, $storeIds)
188
188
'cp.category_id = cps.category_id ' ,
189
189
[]
190
190
)->where (
191
- 'cp.identifier COLLATE utf8_bin = ? ' ,
191
+ 'cp.identifier = ? ' ,
192
192
$ identifier
193
193
)->where (
194
194
'cps.store_id IN (?) ' ,
@@ -226,7 +226,7 @@ protected function isValidPageIdentifier(\Magento\Framework\Model\AbstractModel
226
226
*
227
227
* @param string $identifier
228
228
* @param int|array $storeId
229
- * @return int
229
+ * @return false|string
230
230
*/
231
231
public function checkIdentifier ($ identifier , $ storeIds )
232
232
{
@@ -235,9 +235,15 @@ public function checkIdentifier($identifier, $storeIds)
235
235
}
236
236
$ storeIds [] = \Magento \Store \Model \Store::DEFAULT_STORE_ID ;
237
237
$ select = $ this ->_getLoadByIdentifierSelect ($ identifier , $ storeIds );
238
- $ select ->reset (\Zend_Db_Select::COLUMNS )->columns ('cp.category_id ' )->order ('cps.store_id DESC ' )->limit (1 );
238
+ $ select ->reset (\Zend_Db_Select::COLUMNS )->columns (['cp.category_id ' , 'cp.identifier ' ])->order ('cps.store_id DESC ' )->limit (1 );
239
+
240
+ $ row = $ this ->getConnection ()->fetchRow ($ select );
241
+ if (isset ($ row ['category_id ' ]) && isset ($ row ['identifier ' ])
242
+ && $ row ['identifier ' ] == $ identifier ) {
243
+ return (string )$ row ['category_id ' ];
244
+ }
239
245
240
- return $ this -> getConnection ()-> fetchOne ( $ select ) ;
246
+ return false ;
241
247
}
242
248
243
249
/**
Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ protected function _getLoadByIdentifierSelect($identifier, $storeIds)
340
340
'cp.post_id = cps.post_id ' ,
341
341
[]
342
342
)->where (
343
- 'cp.identifier COLLATE utf8_bin = ? ' ,
343
+ 'cp.identifier = ? ' ,
344
344
$ identifier
345
345
)->where (
346
346
'cps.store_id IN (?) ' ,
@@ -378,7 +378,7 @@ protected function isValidPageIdentifier(\Magento\Framework\Model\AbstractModel
378
378
*
379
379
* @param string $identifier
380
380
* @param int|array $storeId
381
- * @return int
381
+ * @return false|string
382
382
*/
383
383
public function checkIdentifier ($ identifier , $ storeIds )
384
384
{
@@ -387,9 +387,15 @@ public function checkIdentifier($identifier, $storeIds)
387
387
}
388
388
$ storeIds [] = \Magento \Store \Model \Store::DEFAULT_STORE_ID ;
389
389
$ select = $ this ->_getLoadByIdentifierSelect ($ identifier , $ storeIds );
390
- $ select ->reset (\Zend_Db_Select::COLUMNS )->columns ('cp.post_id ' )->order ('cps.store_id DESC ' )->limit (1 );
390
+ $ select ->reset (\Zend_Db_Select::COLUMNS )->columns (['cp.post_id ' , 'cp.identifier ' ])->order ('cps.store_id DESC ' )->limit (1 );
391
+
392
+ $ row = $ this ->getConnection ()->fetchRow ($ select );
393
+ if (isset ($ row ['post_id ' ]) && isset ($ row ['identifier ' ])
394
+ && $ row ['identifier ' ] == $ identifier ) {
395
+ return (string )$ row ['post_id ' ];
396
+ }
391
397
392
- return $ this -> getConnection ()-> fetchOne ( $ select ) ;
398
+ return false ;
393
399
}
394
400
395
401
/**
Original file line number Diff line number Diff line change @@ -134,7 +134,12 @@ public function getOwnTitle($plural = false)
134
134
*/
135
135
public function checkIdentifier ($ identifier )
136
136
{
137
- return $ this ->load ($ identifier )->getId ();
137
+ $ tag = $ this ->load ($ identifier );
138
+ if ($ tag ->getIdentifier () == $ identifier ) {
139
+ return $ tag ->getId ();
140
+ }
141
+
142
+ return null ;
138
143
}
139
144
140
145
/**
You can’t perform that action at this time.
0 commit comments