Skip to content

Commit 7fb8a9c

Browse files
MAGETWO-47240: [GitHub]JavaScript Error on Checkout Page after Changing Country in Estimate Shipping and Tax Block
1 parent 5eb1602 commit 7fb8a9c

File tree

2 files changed

+5
-5
lines changed
  • app/code/Magento
    • Customer/view/frontend/templates/address
    • Ui/view/base/web/js/lib/validation

2 files changed

+5
-5
lines changed

app/code/Magento/Customer/view/frontend/templates/address/edit.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@
7575
value="<?php echo $block->escapeHtml($block->getStreetLine(1)) ?>"
7676
title="<?php /* @escapeNotVerified */ echo __('Street Address') ?>"
7777
id="street_1"
78-
class="input-text <?php /* @escapeNotVerified */
79-
echo $_streetValidationClass ?>"/>
78+
class="input-text <?php /* @escapeNotVerified */ echo $_streetValidationClass ?>"/>
8079
<div class="nested">
8180
<?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
8281
<?php for ($_i = 1, $_n = $this->helper('Magento\Customer\Helper\Address')->getStreetLines(); $_i < $_n; $_i++): ?>
@@ -88,7 +87,8 @@
8887
<input type="text" name="street[]"
8988
value="<?php echo $block->escapeHtml($block->getStreetLine($_i + 1)) ?>"
9089
title="<?php /* @escapeNotVerified */ echo __('Street Address %1', $_i + 1) ?>"
91-
id="street_<?php /* @escapeNotVerified */ echo $_i + 1 ?>" echo $_streetValidationClass ?>">
90+
id="street_<?php /* @escapeNotVerified */ echo $_i + 1 ?>"
91+
class="input-text <?php /* @escapeNotVerified */ echo $_streetValidationClass ?>">
9292
</div>
9393
</div>
9494
<?php endfor; ?>

app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ define([
4949
return _.mapObject({
5050
"min_text_length": [
5151
function (value, params) {
52-
return value.length == 0 || value.length >= +params;
52+
return _.isUndefined(value) || value.length == 0 || value.length >= +params;
5353
},
5454
$.mage.__('Please enter more or equal than {0} symbols.')
5555
],
5656
"max_text_length": [
5757
function (value, params) {
58-
return value.length <= +params;
58+
return !_.isUndefined(value) && value.length <= +params;
5959
},
6060
$.mage.__('Please enter less or equal than {0} symbols.')
6161
],

0 commit comments

Comments
 (0)