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
this checks only for "number" of downloads but does not check if "Unlimited" is selected in product's "downloadable information" section.
If we rely on "unlimited" it fails as when link expires.
See attachment: how is it possible to have "expired" if "Remaining Downloads" are set to "Unlimited"?
This happens because CLEARLY the scandi class takes another approach compared to the magento class it rewrites:
The magento class Magento\Downloadable\Controller\Download\Link on line 100 checks:
if (($downloadsLeft || $linkPurchasedItem->getNumberOfDownloadsBought() === 0))
there is a HUGE difference here between == and === 0
basically it boils down to this.
because the value here (for various reason) could be a string if not a number in the original array (remember php would not throw an error when adding a string that can be converted to a number and would take care of it)
thanks
For the same reason see here how link is marked as expired even if "remaining downloads" shows "Unlimited left"
The text was updated successfully, but these errors were encountered:
Prerequisites:
source: vendor/scandipwa/customer-downloadable-graphql/src/etc/di.xml
Class \ScandiPWA\CustomerDownloadableGraphQl\Controller\Download\Link line 93:
this checks only for "number" of downloads but does not check if "Unlimited" is selected in product's "downloadable information" section.
If we rely on "unlimited" it fails as when link expires.
See attachment: how is it possible to have "expired" if "Remaining Downloads" are set to "Unlimited"?
This happens because CLEARLY the scandi class takes another approach compared to the magento class it rewrites:
The magento class Magento\Downloadable\Controller\Download\Link on line 100 checks:
ScandiPWA\CustomerDownloadableGraphQl\Controller\Download\Link checks instead
there is a HUGE difference here between == and === 0
basically it boils down to this.
because the value here (for various reason) could be a string if not a number in the original array (remember php would not throw an error when adding a string that can be converted to a number and would take care of it)
thanks
For the same reason see here how link is marked as expired even if "remaining downloads" shows "Unlimited left"
The text was updated successfully, but these errors were encountered: