From 3dadd3a584b500693e6f112583d368b9a5a554fd Mon Sep 17 00:00:00 2001 From: PromInc Date: Wed, 8 Sep 2021 10:14:02 -0500 Subject: [PATCH 1/2] Prevent JS error in an empty cart This is the JS error thrown: "Uncaught TypeError: Cannot read properties of undefined (reading '0')" Steps to recreate: * Visit an empty cart page * Look in the developer tools console tab and notice the error --- view/frontend/web/js/affirmPixel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/view/frontend/web/js/affirmPixel.js b/view/frontend/web/js/affirmPixel.js index 65137f36..f5246e49 100644 --- a/view/frontend/web/js/affirmPixel.js +++ b/view/frontend/web/js/affirmPixel.js @@ -58,8 +58,9 @@ define([ function sendTracker(options){ affirm.ui.ready(function(){ - - affirm.analytics[options.method](options.parameter[0], options.parameter[1], options.parameter[2]); + if( options.method && options.parameter ) { + affirm.analytics[options.method](options.parameter[0], options.parameter[1], options.parameter[2]); + } }); } From b1ee851003d55a51e5fe024a9400d3daf490bbbc Mon Sep 17 00:00:00 2001 From: PromInc Date: Tue, 7 Feb 2023 08:10:32 -0600 Subject: [PATCH 2/2] Update Date.php Bug fix: datepicker doesn't load and thus prevents saving of the page. --- Block/System/Config/Form/Field/Date.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Block/System/Config/Form/Field/Date.php b/Block/System/Config/Form/Field/Date.php index b9ee5138..d250d1b5 100644 --- a/Block/System/Config/Form/Field/Date.php +++ b/Block/System/Config/Form/Field/Date.php @@ -62,7 +62,7 @@ protected function _getElementHtml(\Magento\Framework\Data\Form\Element\Abstract $this->_coreRegistry->registry('datepicker_loaded', 1); } $html .= '