You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DimitriBouriez opened this issue
May 10, 2024
· 3 comments
Labels
8.1.xBranchBugType: BugNMIStatus: issue needs more informationOrderComponent: Which BO section is concernedStocksLabel: Which BO under menu is concernedWaiting for QAStatus: action required, waiting for test feedback
I had a problem with retrieving the stock location for products that are no longer available when viewing an old order. Normally, this should return false when the stock location is not found. But when the Memcached cache is active, the null value is returned, causing a fatal error. This must be linked to the fact that Memcached doesn't distinguish between null and false.
To correct my specific problem, I added the following processing at the end of the setProductCurrentStock() method in /classes/order/Order.php:
if ($product['location'] === null) {
$product['location'] = false;
}
This ensures that false is returned and not null.
The following issues seem to be affected by a similar bug: #22215 #35753 #35979
Expected behavior
No response
Steps to reproduce
Enable Memcached cache
Create an order
Delete an ordered product from the catalog
View order
PrestaShop version(s) where the bug happened
8.1.2
PHP version(s) where the bug happened
No response
If your bug is related to a module, specify its name and its version
No response
Your company or customer's name goes here (if applicable).
No response
The text was updated successfully, but these errors were encountered:
Do you have the same issue with memcached disabled ?
Thanks!
florine2623
added
Waiting for author
Status: action required, waiting for author feedback
NMI
Status: issue needs more information
Order
Component: Which BO section is concerned
Stocks
Label: Which BO under menu is concerned
8.1.x
Branch
and removed
New
New issue not yet processed by QA
labels
May 14, 2024
8.1.xBranchBugType: BugNMIStatus: issue needs more informationOrderComponent: Which BO section is concernedStocksLabel: Which BO under menu is concernedWaiting for QAStatus: action required, waiting for test feedback
Prerequisites
Describe the bug and add attachments
I had a problem with retrieving the stock location for products that are no longer available when viewing an old order. Normally, this should return false when the stock location is not found. But when the Memcached cache is active, the null value is returned, causing a fatal error. This must be linked to the fact that Memcached doesn't distinguish between null and false.
To correct my specific problem, I added the following processing at the end of the setProductCurrentStock() method in /classes/order/Order.php:
if ($product['location'] === null) {
$product['location'] = false;
}
This ensures that false is returned and not null.
The following issues seem to be affected by a similar bug:
#22215
#35753
#35979
Expected behavior
No response
Steps to reproduce
PrestaShop version(s) where the bug happened
8.1.2
PHP version(s) where the bug happened
No response
If your bug is related to a module, specify its name and its version
No response
Your company or customer's name goes here (if applicable).
No response
The text was updated successfully, but these errors were encountered: