When saving a node with location cck locations, the locations don't get saved.

What is happening is the location is being saved and then deleted again.

This is somehow related to location_node and location_cck both calling location_save_locations.

For example location_node_node_insert() and location_cck_field_insert() both call it at the same time and location_node_node_update() and location_cck_field_update() both call it at the same time.

Comments

rooby’s picture

This is an old issue so doesn't need to be addressed to consider 7.x-3.x ported and can be fixed later.

For the drupal 6 issue see #906968: CCK Location Fields do not save when Node Locations are enabled.

rooby’s picture

Looking at it again, in D7 it seems that even when node locations are disabled for a given content type the problem persists.
Will have to look into it further and hopefully there will be an easy work around type solution to get things to the same functionality we have in D6.

Otherwise a proper fix will probably require a rewrite of the location_save_locations / location_save functionality. - I have looked a bit into an easier fix to this code but it looks like it might require rewriting.

Such a rewrite will probably want to happen in the next version anyway. Although if the entire system moves to use field API there will be some larger changes anyway.

rooby’s picture

Status: Active » Fixed

I have committed workaround that allows you to use cck locations on node types that aren't using node locations. This is how it is currently in D6 so it is an acceptable level of functionality for the port.

For it to work you must set the maximum number of locations to zero for node locations on the content types you are using cck locations for.

A better fix to allow everything to work together in harmony will require some rewriting so will probably be done in the next major version.

http://drupal.org/cvs?commit=494658

acarpio’s picture

Seems to me that this problem appears again in the feb 10 release. As you said, I "set the maximum number of locations to zero for node locations", but it is not saving location cck information. I tried also disabling node locations but not working either for saving locations cck. This has also been reported in http://drupal.org/node/1026970 #6

On another hand, previous 7.x-3.x release did save location cck fields but it did not display any information (I assumed that was part of the development status). This has also been reported in http://drupal.org/node/1026970 #5

Thanks.

rooby’s picture

The formatters were previously not ported for location cck so the locations didn't display when viewing nodes. For that issue see #1056156: Finish implementing hook_field_formatter_info() and hook_field_formatter_view() for location_cck

The other issue you refer to are for 7.x-4.x, not 7.x-3.x so it is unrelated to this issue.

It is possible that your locations are saving but not displaying.
If that is the case, try again when the next dev release gets packaged as the formatters are working now (except for the gmap related formatters).

bryancasler’s picture

We've been talking about location data not saving over here, feel free to check it out and contribute.

#1064666: Location CCK not saving for entities other than nodes

Status: Fixed » Closed (fixed)

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