I am using CNR with trackfield. The content type (loop) with trackfield is linked to another content type (poi).

Updating POI throws errors about invalid join arguments on line 281 of trackfield.module and the track maps become a blue/grey color. Resaving the node with trackfield brinks the maps back.

When the updates are triggered by the CNR module, "presave" is never called so the $item[$settype] values are null. The CNR module calls content_update($node) to update the node.

I don't know what does or should trigger "presave", so I'm not sure if this should be fixed in trackfield or cnr.

Thank you.

Comments

raintonr’s picture

Have you raised this with the CNR module maintainer?

Line 281 of trackfield.module is inside this function... does this match your code?

273	function trackfield_widget_settings($op, $widget) {
274	  switch ($op) {
275	    case 'form':
276	      global $_trackfield_norm_types;
277	      $form = array();
278	      $form['normalise'] = array(
279	        '#type' => 'select',
280	        '#title' => t('Normalise As'),
281	        '#default_value' => isset($widget['normalise']) ? $widget['normalise'] : '',
282	        '#options' => $_trackfield_norm_types,
283	      );
284	      $form['take_location'] = array(
285	        '#type' => 'select',
286	        '#title' => t('Use co-ordinates from this track to overwrite node location where possible'),
287	        '#default_value' => isset($widget['take_location']) ? $widget['take_location'] : '0',
288	        '#options' => array('1' => 'Yes', '0' => 'No')
289	      );
290	      return $form;
291	
292	    case 'save':
293	      return array('normalise', 'take_location');
294	  }
295	}

Please copy/paste the exact error.

ejwettstein’s picture

1) Have not yet raised with CNR.
2) No. It matches 262.

249    case 'insert':
250	      /* Check and queue if module is on, otherwise just insert now. */
251	      if (!module_exists('trackfield_queue') || !_trackfield_queue_check_queue($items, $node)) {
252	        foreach ($items as $delta => $item) {
253	          /*
254	           * If the hooks generated some datasets, store them.
255	           * Delete whatever is there first - perhaps some will have
256	           * been removed.
257	           */
258	  
259	          db_query("DELETE FROM {trackfield_datasets} WHERE nid = %d and vid = %d and field_name = '%s' and delta = %d", $node->nid, $node->vid, $field['field_name'], $delta, $settype, $item[$settype]);
260	          if (array_key_exists('trackdatasets', $item)) {
261	            foreach (split(',', $item['trackdatasets']) as $settype) {
262	              db_query("INSERT INTO {trackfield_datasets} (nid, vid, field_name, delta, settype, setdata) VALUES (%d, %d, '%s', %d, '%s', '%s')",
263	                $node->nid, $node->vid, $field['field_name'], $delta, $settype,
264	                join(',', $item[$settype]));
265	            }
266	          }
267	        }
268	      }
269	      break;

3) warning: join() [function.join]: Invalid arguments passed in /etc/drupal/6/sites/all/modules/trackfield/trackfield.module on line 284.
warning: join() [function.join]: Invalid arguments passed in /etc/drupal/6/sites/all/modules/trackfield/trackfield.module on line 284.
warning: join() [function.join]: Invalid arguments passed in /etc/drupal/6/sites/all/modules/trackfield/trackfield.module on line 284.