Steps to reproduce on a fresh install of Drupal Commons:

Go to Events -> List an Event (node/add/event)
Fill in Title and Description
For Location, select "Online" (the address fields will disappear as expected)

Press Save.

You'll receive these errors:

Address 1 field is required.
City field is required.
State field is required.
ZIP code field is required.

As #2412849: Addressfield is required on user registration form even if checked as non required explains, an optional address must be set to None in order to pass validation, and the default country of United States, hidden as it is and not sent to none, fails.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mlncn created an issue. See original summary.

mlncn’s picture

Assigned: Unassigned » mlncn

Excited to see that Social for Drupal 8 looks to pick up where Commons left off. In the meantime, patch will be incoming for commons_events.

mlncn’s picture

Status: Active » Needs review
FileSize
671 bytes

This does it: When the location is changed to Online, set the Country of the addressfield (simultaneously hidden by States API) to none (''). People can now save online events. Christmas is saved.

mlncn’s picture

Slight improvement; set the country back to the US if people change back from Online.

mlncn’s picture

Here's the final offer: set the country back to whatever the default country is when changing back from Online to Physical or Physical and Online.

Note: SimplyTest.me doesn't work because it provides OpCache memory of 64 which "is not enough space to successfully install Drupal Commons. Change the capacity to at least 96."

But presumably this means it is able to apply the patch to Commons, and i've tested thoroughly. Please review!

eellingwood@nichq.org’s picture

Status: Needs review » Reviewed & tested by the community

Worked for us! We're using this on several production sites.