Skip to content

Commit 2056b4b

Browse files
authored
Fix warning "Warning: A non-numeric value encountered" in Model_Url (#933)
Cast value to int and change isset to !empty to privent url model to add empty string to an 1.
1 parent 022dba0 commit 2056b4b

File tree

1 file changed

+1
-1
lines changed
  • app/code/core/Mage/Catalog/Model

1 file changed

+1
-1
lines changed

app/code/core/Mage/Catalog/Model/Url.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ public function getUnusedPathByUrlKey($storeId, $requestPath, $idPath, $urlKey)
676676
$match['increment'] = $lastRequestPath;
677677
}
678678
return $match['prefix']
679-
. (isset($match['increment']) ? ($match['increment'] + 1) : '1')
679+
. (!empty($match['increment']) ? ((int)$match['increment'] + 1) : '1')
680680
. $match['suffix'];
681681
}
682682
else {

0 commit comments

Comments
 (0)