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.
For some reason ALL my content types are showing a location field. How do I remove the location field from showing. There is no delete field in the manage field tabs and I don't see any way to turn it off in the admin screen. How do I select which content type to show it on?
Comment | File | Size | Author |
---|---|---|---|
#12 | location-location-field-2331659-12-D7.patch | 1.57 KB | dlaufer |
Comments
Comment #1
GilAnder CreditAttribution: GilAnder commentedHI,
To dismiss the Location field, you have to modify the concerned content type -> Locative information and set the maximum number of locations to 0.
Hope this will help.
Comment #2
js CreditAttribution: js commentedI have a location field on unnecessary content types with only these fields
Label: Location
Machine name: locations
Field type: Location module form elements
without widget or operations. So I can't edit the maximum number of locations directly.
I am getting an error from entity.inc
warning: array_flip(): Can only flip STRING and INTEGER values!
which I hope is related.
This problem might be the result of upgrading D6 to D7.
Any help would be appreciated.
Comment #3
vishalgala CreditAttribution: vishalgala commentedComment #4
legolasboClosing support tickets that have been inactive for over a year to clean up the issue queue. Please reopen if this is still an issue.
Comment #5
smurfxx CreditAttribution: smurfxx commentedProblem is still here, every new content type has a location field and not editable.
I'm on Drupal 7.50
Comment #6
smurfxx CreditAttribution: smurfxx commentedComment #7
smurfxx CreditAttribution: smurfxx commentedComment #8
legolasboCritical seems a little over the top for an issue that has been inactive for 2 years.
Comment #9
rooby CreditAttribution: rooby commentedThe location module is adding this with location_field_extra_fields() but it is the location_node module that actually uses it, so if you don't use the location_node module then it is there for nothing.
Seems like location_field_extra_fields() should be in the node_location module instead.
Comment #10
jimmynash CreditAttribution: jimmynash commentedI had already disabled and uninstalled the location_node module and was still seeing the Locative Information field in the manage fields area of all my content types.
Since there was no implementation of hook_extra_fields in the location_node module I moved the hook from the location module to the location_node module and changed the function name to match it's new home. Cleared the cache and the field no longer shows in the manage fields area.
I then re-enabled the location_node module and the extra field was back provided now by location_node. Disabling location_node then removed the field from the manage fields area.
So, I removed this function from location.module
and moved it to location_node.module
renaming it to this
This seemed to do the trick for me.
Comment #11
rooby CreditAttribution: rooby commented@jimmynash:
Yep, that is the solution mentioned in #9
Could you make a patch for that?
Comment #12
dlaufer CreditAttribution: dlaufer as a volunteer and commentedPatch from #10 to move location_field_extra_fields() from location.module to location_node.module so that the Location module form elements field gets removed when disable location_node.
Comment #13
dlaufer CreditAttribution: dlaufer as a volunteer and commentedComment #14
davemybes CreditAttribution: davemybes as a volunteer commentedThis works great and fixes the small annoyance of having the field always there. Thanks!
Comment #15
TechnoTim2010 CreditAttribution: TechnoTim2010 as a volunteer commentedHi
Installed the patch in #12 and can confirm it works, no bugs to report and can be set as RTBC
Tim