Fix bug whereby cidZero does not prepopulate billing details for selected contact...
authoreileen <emcnaughton@wikimedia.org>
Mon, 21 Oct 2019 04:43:40 +0000 (17:43 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 21 Oct 2019 04:55:50 +0000 (17:55 +1300)
commitf956cd2487422e5fd179d40d976a36e17f37b283
treeb07c42a00c9692d87706ea4f0edd65f8d228e1e8
parente59fdaad543f0d26b0dd3bd4704b79f2f88ea1f9
Fix  bug whereby cidZero does not prepopulate billing details for selected contact for pay later.

To replicate
1) create a contribution page  & select  pay later   (and no other processor)  with 'billing  address required'
2) access the contribution page with cid=0 in the url
3) select a contact - witness  the contacts  detaisl have NOT loaded  into the billing block
4) follow the same steps  on event

I was trying to reduce complexity on  this form for another  change when  I realised  that  the variable
to determine  whether to show the block  was  wrong  when  billing details  were  required  for
pay later and  on testing  there  seemed now downside (other than a very minor performance
hit in  obscure  circumstances) in just always loading the billing profile  details.

I saw no js error  when the billing block was  NOT present  and we are already checking
the person has access  to see the contact so that is not an issue here (Profile.get
does a permission check
CRM/Contribute/Form/Contribution/Main.php
CRM/Core/Form.php
CRM/Event/Form/Registration/Register.php