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

JS error on the address book process page because #stBreak element is missing #97

Closed
marco-pm opened this issue Nov 10, 2021 · 1 comment
Labels
bug Something isn't working fix provided A correction has been provided
Milestone

Comments

@marco-pm
Copy link

index.php?main_page=address_book_process&edit=1:720 Uncaught TypeError: Cannot set properties of null (setting 'className')
    at hideStateField (index.php?main_page=address_book_process&edit=1:720)
    at update_zone (index.php?main_page=address_book_process&edit=1:423)
    at onload (index.php?main_page=address_book_process&edit=1:888)

This is because the bootstrap template doesn't include the stBreak element, and in the ZC script jscript_addr_pulldowns.php (under address_book_process) there is no check that stBreak actually exists on the page (unlike stText):

    if (document.getElementById("stText")) {
      document.getElementById("stText").className = 'hiddenField';
      document.getElementById("stText").setAttribute('className', 'hiddenField');
    }
    document.getElementById("stBreak").className = 'hiddenField';
    document.getElementById("stBreak").setAttribute('className', 'hiddenField');

I would therefore add it somewhere, e.g. in tpl_address_book_process_default.php, with d-none class, so that the js error is not thrown. Of course the ideal solution would be to add the check in the ZC core js file.

@marco-pm marco-pm changed the title JS error on the address book process because #stBreak element is missing JS error on the address book process page because #stBreak element is missing Nov 10, 2021
@lat9 lat9 added the bug Something isn't working label Nov 25, 2021
@lat9 lat9 added this to the v3.1.6 milestone Nov 25, 2021
@lat9
Copy link
Owner

lat9 commented Nov 25, 2021

Noting that the change is made to tpl_modules_common_address_format.php so that the issue gets squished for the create-account and multi-page checkout pages' processing, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix provided A correction has been provided
Projects
None yet
Development

No branches or pull requests

2 participants