[MSHOP-123] "Billing address same as shipping address" in sample shop results in email validation error Created: 07/Feb/14  Updated: 22/Apr/15  Resolved: 09/Mar/15

Status: Closed
Project: Magnolia Shop (closed)
Component/s: None
Affects Version/s: 2.0
Fix Version/s: 2.1.1, 2.2

Type: Bug Priority: Major
Reporter: Edgar Vonk Assignee: AntonĂ­n Juran
Resolution: Fixed Votes: 0
Labels: evaluate
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MacOS, Magnolia EE 5.2.2, Chrome


Attachments: PNG File Screen Shot 2014-02-07 at 11.31.07.png    
Issue Links:
causality
caused by MGNLFORM-200 Validation of email field is required... Closed
duplicate
is duplicated by MSHOP-140 Billing same as shipping address: val... Closed
is duplicated by MSHOP-173 In step 2 to shopping cart is require... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

New in Shop Module 2.0: the "Billing address same as shipping address" option in the checkout form of the sample shop no longer works. It gives an error indicating that the e-mail address for the billing address is absent.

I have not looked into it any further. Maybe the billing address is no longer correctly copied from the shipping address?



 Comments   
Comment by Milan Divilek [ 04/Mar/15 ]

Reopen:
1. Please remove unnecessary call of getFormModel method. Possible NPE -> Add check if getFormModel() module didn't return null value.

info.magnolia.module.shop.paragraphs.CheckDisableFieldsModel
public Map getFormStateValues() {
   getFormModel();
   return getFormModel().getFormState().getValues();
}

2.new NodeExistsDelegateTask("Set modelClass property if /modules/shop/templates/components/features/form/shopCheckDisableFields node exists", "", RepositoryConstants.CONFIG, "/modules/shop/templates/components/features/form/shopCheckDisableFields", new SetPropertyTask("", RepositoryConstants.CONFIG, "/modules/shop/templates/components/features/form/shopCheckDisableFields", "modelClass", "info.magnolia.module.shop.paragraphs.CheckDisableFieldsModel"))

Please use constructor with autogenerated description and repository name for NodeExistsDelegateTask. And use constructor with autogenerated taskName and description for SetPropertyTask

3.In checkDisableFields freemarker template you are hardcoding filling just for three fields (billingAddressStreet, billingAddressMail, billingAddressFirstname). Please make this more generic. So if somebody adds another field he doesn't need to change ftl template.

Comment by Milan Divilek [ 06/Mar/15 ]

Reopen:
If I have field called billingSomething, but field shippingSomething doesn't exist then scrip fails on NPE
[Error] TypeError: null is not an object (evaluating 'document.getElementById(key).value = ""')
[Error] TypeError: null is not an object (evaluating 'document.getElementById(key).value = map[key]')

Comment by AntonĂ­n Juran [ 06/Mar/15 ]

https://developer.mozilla.org/en-US/docs/Web/API/Node/contains

Comment by Milan Divilek [ 09/Mar/15 ]

Reopen:

The following has evaluated to null or missing:
==> model.getFormStateValues()  [in template "shop/paragraphs/features/form/checkDisableFields.ftl" at line 1, column 29]
Generated at Mon Feb 12 07:09:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.