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.
Hi again,
I'm using Drupal 7.9, Location 7.x-3.x-dev and Location taxonomize 7.x-2.x-dev.
Node locations are taxonomized great, but if I try to use field locations provided by Location CCK submodul of Location, creation of a node with this field doesn't produce any taxonomy terms.
Comments
Comment #1
kvit CreditAttribution: kvit commentedI'm closing it myself as I think this issue belongs to Location CCK and it won't be fixed due to #1346746: Roadmap for next gen location (7.x-5.x)
Comment #2
cbeier CreditAttribution: cbeier commentedI think the support of Location CCK is very helpful. Actually, everythink works, only after saving the "location_taxonomize_location_submitt" is not executed, because the submit handler is not set.
Comment #3
cbeier CreditAttribution: cbeier commentedAttached a patch for the support of Location CCK. A combination of Location Node and Location CCK should be possible (not tested).
At the moment it is assumed that the CCK field has the name 'field_locations'.
Comment #4
goron CreditAttribution: goron commentedComment #5
goron CreditAttribution: goron commentedIf other people are using this patch successfully, please post here to let me know, which will mean I will need to test less. Thanks.
Comment #6
goron CreditAttribution: goron commentedcbeier, are you using this patch?
Comment #7
cbeier CreditAttribution: cbeier commentedgoron: Yes, also in production.
Comment #8
goron CreditAttribution: goron commentedPatch seems mostly fine to me. The only problem is the hardcoded name for the field. Is there no way to detect whether there is a location cck field on the form (short of looping through all the form elements)? If not, could do one of the following:
cbeier (and anyone else interested), if you have any time for this your thoughts and/or another patch would be welcome. I'm a bit swamped at the moment, so I don't know when I'll have time to implement this.
Comment #9
RaulMuroc CreditAttribution: RaulMuroc commentedSome advance on this?
I tested the patch. It worked fine with Location CCK fields. It bulked all location cck to the newly created vocabulary as terms having a hierarchical term listing with Countries as parent terms and Cities as child terms.
I would recommend to create a new checkbox: " Location - Location CCK" in the Modules list. Currently there are "Location and Location - Address Field" so an extra box would clarify either you want to use for Location itself or Location CCK fields when you are going to active module.
Furthermore as commented in: #1541310: Get Location Taxonomize to work all entities, not just nodes it does not work nicely for Location CCK fields in Profile2 content type: Is true that I have the Hierarchical list of terms, but whatever I click on Countries or Cities it redirects to an empty page saying " There is currently no content classified with this term. "
So now we should all work to implement patches to work it for all entity types, specially Profile2 because I think there is the place most often used.
Thanks for great work.
Comment #10
wemmies CreditAttribution: wemmies commentedI can confirm that the patch is working. Have to do some more extensive testing, but is looking good so far. Only problem is indeed the hardcoded fieldname, but that's not a big issue for me.
Thnx
Comment #11
danon1981 CreditAttribution: danon1981 commentedI can confirm the patch is working and would really appreciate if support for taxonomizing the location cck field on node save would be moved into the next module update.
Only problem I face is that I set the address on a node through rules and also save the entity from rules. That does not trigger the location to be taxonomized. It only works when actually using the manual save action on the node itself. I think this should also work, I don't know if this would have worked without the patch, can't check.
Comment #12
klaasvw CreditAttribution: klaasvw commentedHere's a slightly different approach. It will use the bulk function instead and works by checking for the linked location directly. This works with any type of module that saves location data and it unifies the way data is saved. This also means it will work with any field name.
I also tried using the entity/node insert and update hooks but this will cause an infinite loop because saving the taxonomy term also uses node_save. Maybe something for a different issue?
Comment #13
Berliner-dupe CreditAttribution: Berliner-dupe commentedHe klaasvw,
thank you for this patch. After i used your patch although i get 3 Notices (php Notice: Undefined property: stdClass::) but i fix it with
if (isset(...))
quickly.After this it works perfect with all location-cck-fields.
Great! Thank you very much - your Patch help me a lot.
Best Regards Matthias
Comment #14
balajidharmaHere i am using hook_field_widget_form_alter to get the location fields.
This patch also support multiple location fields in same node.
Let me know if you have any issues
Comment #15
balajidharmaAttached a updated patch for the support of Location CCK.
Comment #16
QNDY CreditAttribution: QNDY commentedThanks for the patch! It works great but unfortunately I get a fatal error when using multiple locations
Comment #17
balajidharmaHi Quinten,
Kindly upload the error page screenshot, it will help to resolve the issue.
Thanks,
Balaji D
Comment #18
QNDY CreditAttribution: QNDY commentedWhen im entering 2 locations I get this fatal error. It does not save it and jumps back to create the same node! And I get this also when I leave the location field empty. Futhermore I get 'Notice: Undefined index: #node_edit_form in location_taxonomize_form_alter() (line 35' when editing the location field.
Comment #19
QNDY CreditAttribution: QNDY commentedDid some extra tests. And the following will give an error: when the location field is set to unlimited it gives the error but when it is changed to for example 2 values it works.
Comment #20
balajidharmaOk Quinten, i will check and update you.
Thanks,
Balaji D
Comment #21
balajidharmaHi Quinten,
The mentioned issue has been resolved, kindly apply this patch and verify.
Let me know if you have any concerns
Thanks,
Balaji D
Comment #22
QNDY CreditAttribution: QNDY commentedHi Balajidharma,
I can confirm that it works! Great work.
I only get this small notification when editing the location field:
Notice: Undefined index: #node_edit_form in location_taxonomize_form_alter() (line 36
Already before the latest patch. Nevertheless the functions are working perfectly!
Comment #23
3magnus CreditAttribution: 3magnus commentedThe patch in #21 works for integration with both Address Field and Location, since you set 'field_locations' as machine name for your address/location field.