Active
Project:
Location
Version:
7.x-3.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Dec 2015 at 18:50 UTC
Updated:
16 Dec 2015 at 18:50 UTC
Jump to comment: Most recent
The function location_addanother_form_submit incorrectly coded to determine the 'nid'.
A fix is proposed below that works.
/**
* Submission function for "add another location" form.
*/
function location_addanother_form_submit($form, &$form_state) {
$location = $form_state['values']['location'];
// $node = node_load($location['nid']);
$node = $form_state['#node']; // Replacement code for the line 117 above
$locations = $node->locations;
// unset($location['nid']); // Code not required
$locations[] = $location;
location_save_locations($locations, array('nid' => $node->nid, 'vid' => $node->vid));
return 'node/' . $node->nid;
}
Comments