Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicated elements id in checkout. billing-new-address-form #17061

Closed
LiamKarlMitchell opened this issue Jul 24, 2018 · 13 comments
Closed

Duplicated elements id in checkout. billing-new-address-form #17061

LiamKarlMitchell opened this issue Jul 24, 2018 · 13 comments
Labels
Component: Checkout Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@LiamKarlMitchell
Copy link

Preconditions

  1. Added Cash on Delivery, Bank Transfer and a custom payment method Payment Express

Magento Version: 2.2.4

Steps to reproduce

  1. Load checkout with an item in cart.

Expected result

  1. Can view payment methods, choose one and continue to "Place Order"

Actual result

  1. [DOM] Found 3 elements with non-unique id #billing-new-address-form: (More info: https://goo.gl/9p2vKq) <fieldset id=​"billing-new-address-form" class=​"fieldset address">​…​</fieldset>​ <fieldset id=​"billing-new-address-form" class=​"fieldset address">​…​</fieldset>​

Error in Google Chrome Version 67.

Unable to pay for the order further with any selected payment method.
"Continue to PxPay", or "Place Order"

This is related to / mentioned in #13415 but was never addressed for the billing-new-address-form and that issue is now closed as done.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jul 24, 2018
@magento-engcom-team
Copy link
Contributor

Hi @LiamKarlMitchell. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@LiamKarlMitchell do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@LiamKarlMitchell
Copy link
Author

@magento-engcom-team give me 2.2.4 instance

@magento-engcom-team
Copy link
Contributor

Hi @LiamKarlMitchell. Thank you for your request. I'm working on Magento 2.2.4 instance for you

@magento-engcom-team
Copy link
Contributor

Hi @LiamKarlMitchell, here is your Magento instance.
Admin access: https://i-17061-2-2-4.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@LiamKarlMitchell
Copy link
Author

@magento-engcom-team Yes reproduced.

image

Although the "Place Order" buttons still appear to work so that must be breaking from something else on my end.

@ghost ghost self-assigned this Jul 24, 2018
@ghost ghost added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: Checkout Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Jul 24, 2018
@ghost
Copy link

ghost commented Jul 24, 2018

@LiamKarlMitchell, thank you for your report.
We've acknowledged the issue and added to our backlog.

@ghost ghost removed their assignment Jul 24, 2018
@ihor-sviziev
Copy link
Contributor

Looks like this issue was fixed in #15344

@LiamKarlMitchell
Copy link
Author

LiamKarlMitchell commented Jul 24, 2018

Thanks I'll check it tomorrow I'm hoping to have this fixed asap :)

It seems the solution is to put a data bind property in for the id, with something added onto it to make it unique. (Such as)

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<div class="billing-address-form" data-bind="fadeVisible: isAddressFormVisible">
    <!-- ko foreach: getRegion('before-fields') -->
    <!-- ko template: getTemplate() --><!-- /ko -->
    <!--/ko-->
    <form data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">
        <fieldset data-bind="attr: {id: 'billing-new-address-form-' + getCode($parent)}" class="fieldset address">
            <!-- ko foreach: getRegion('additional-fieldsets') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
            <!-- ko if: (isCustomerLoggedIn && customerHasAddresses) -->
            <div class="choice field">
                <input type="checkbox" class="checkbox" id="billing-save-in-address-book" data-bind="checked: saveInAddressBook, attr: {id: 'billing-save-in-address-book-' + getCode($parent)}" />
                <label class="label" data-bind="attr: {for: 'billing-save-in-address-book-' + getCode($parent)}">
                    <span data-bind="i18n: 'Save in address book'"></span>
                </label>
            </div>
            <!-- /ko -->
        </fieldset>
    </form>
</div>

But I don't know what kind of follow on effect that might have, if anything else addresses those elements by the id?

LiamKarlMitchell added a commit to LiamKarlMitchell/magento2 that referenced this issue Jul 24, 2018
The id duplication was causing errors in chrome.
Resolves magento#17061
@LiamKarlMitchell
Copy link
Author

Added code from above as commit just using githubs edit file thing.
checkbox chances from #15344 I just copied it for the fieldset and tweaked.

@ihor-sviziev
Copy link
Contributor

Hi @LiamKarlMitchell,
Could you confirm than issue is fixed for you?

@DanielRuf
Copy link
Contributor

Removing the ID should be sufficient as the ID is nowhere used as far as I can see.

@DanielRuf
Copy link
Contributor

As this is already in 2.2-develop I'llc lose this one.

@ihor-sviziev ihor-sviziev added Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line labels Jul 31, 2018
@DanielRuf DanielRuf mentioned this issue Aug 1, 2018
4 tasks
@LiamKarlMitchell
Copy link
Author

LiamKarlMitchell commented Sep 5, 2018

Yeah it did fix it thanks.
Just need it as an additional module to back-port for other sites.
Will try just deleting the id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Checkout Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

4 participants