I'm having a problem working with any values uploaded with node_import. Some fields need to get changed or rewritten, some need to get unset, etcetera. Using hooks from the module or Drupal, I'm only seeing values from the CSV file that passed validation and not the one's I'd like to fix.
What am I missing here? Specifically, I'd like to rework some date fields and get Excel mapped to a short date. ('have seen the traffic on this) How can I find the values from the upload, before they're being validated?
These tries didn't show me the upload values:
function gswwimport_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if($op == 'validate' && $node->type == 'event')
{ dsm(func_get_args()); }
}
function gswwimport_form_alter(&$form, &$form_state, $form_id)
{
if($form_id == 'event_node_form')
{ dsm(func_get_args()); }
}
function gswwimport_node_import_values_alter(&$values, $type, $defaults, $options, $fields, $preview) {
dsm(func_get_args());
}
function gswwimport_node_import_fields_alter(&$fields, $type)
{
dsm(func_get_args());
}
Comments
Comment #1
Robrecht Jacques commentedIf you want to change one specific field for one specific content type, you can use:
Alternatively, you can check the
'input_format'key of the field definition to add your handler to all fields of'date'type:Somewhat untested, but that is the idea of it.
Comment #2
Robrecht Jacques commentedComment #3
avpadernoI am closing this issue, since it's for a Drupal version no longer supported.