Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | fixed_required_coordinates.patch | 1.02 KB | grendzy |
fixed_required_coordinates.diff | 775 bytes | slashwalk | |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedIs this really a bug? Please explain.
Comment #2
grendzy CreditAttribution: grendzy commentedYes, 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.
Comment #3
YesCT CreditAttribution: YesCT commentedtagging
Comment #4
rooby CreditAttribution: rooby commentedThis 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?
Comment #5
recrit CreditAttribution: recrit commentednot 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.
Comment #6
grendzy CreditAttribution: grendzy commentedresetting status, since #5 confirms this issue is specific to the lat/long fields, which was my observation as well.
Comment #7
rooby CreditAttribution: rooby commentedAgreed 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