When setting the Location settings of a content type, changing Collection Settings > Coordinate Chooser to "Require" does not make the Latitude and Longitude fields required. This patch fixes this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

YesCT’s picture

Priority: Critical » Normal
Status: Active » Needs review

Is this really a bug? Please explain.

grendzy’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
1.02 KB

Yes, this is a bug.
Steps to reproduce:
-- Navigate to /admin/content/node-type/page
-- Enable locations and set coordinate chooser to "require"
-- Navigate to /node/add/page
-- Submit page without entering coordinates.

Expected behavior:
-- Form validation fails.
-- Stars are displayed next to text fields.

Actual behavior:
-- page is saved with required fields empty.

Here's a reroll. Taking the liberty of marking RTBC since I didn't change any of the code.

YesCT’s picture

Issue tags: +location bdragon check

tagging

rooby’s picture

Title: Setting the coordinates chooser collection settings to "Require" doesnt make the Latitude and Longitude fields required » Node locations "Require" setting doesn't make the fields required.
Status: Reviewed & tested by the community » Needs work

This actually affects all fields, not just the coordinate chooser (unless it's just me, can you confirm?).

Can you make a patch that fixes it for all of the fields?

recrit’s picture

not sure if this is a bug or just poor description as to what the node settings do. If you have Minimum number of locations set to 0, then the module takes this as the whole location is optional and "relaxes" each fields required setting - ie makes them optional even if they are set to required.

If you do have min number of locations set to 0, then:
Fix - set it to 1. Then all of your field requirements will be enforced.

grendzy’s picture

Title: Node locations "Require" setting doesn't make the fields required. » Setting the coordinates chooser collection settings to "Require" doesnt make the Latitude and Longitude fields required
Status: Needs work » Reviewed & tested by the community

resetting status, since #5 confirms this issue is specific to the lat/long fields, which was my observation as well.

rooby’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -location bdragon check

Agreed and works for me too.

Committed to 5, 6 & HEAD with a couple of white space fixes.
http://drupal.org/cvs?commit=429424
http://drupal.org/cvs?commit=429418
http://drupal.org/cvs?commit=429426

Status: Fixed » Closed (fixed)
Issue tags: -location, -Coordinate Chooser, -Required Fields

Automatically closed -- issue fixed for 2 weeks with no activity.