Image file tokens are ignored

jurta - September 29, 2009 - 21:30
Project:Imagefield Import
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:fixed
Description

Currently this modules ignores image tokens specified for the image file field. For instance, when the FileField path is "[termpath]", ALT and Title text is "[title-raw]", then it puts the image file to the directory "[termpath]" literally, and displays a node with literal ALT and Title image tags "[title-raw]".

#1

jurta - September 29, 2009 - 21:54
Status:active» needs review

Normally (i.e. when a node is saved from the node creation form) filefield_paths_nodeapi called with the "insert" op argument invokes the "filefield_paths_process_file" hook on all modules that implement it (e.g. "imagefield_tokens_filefield_paths_process_file" that replaces 'alt' and 'title' tokens).

But in a batch import filefield_paths_get_fields called from filefield_paths_nodeapi return FALSE, because filefield_filefield_paths_get_fields in filefield_paths/modules/filefield.inc checks for the following condition:

  $node->form_id == $node->type .'_node_form'

but $node->form_id is not initialized when Imagefield import is used. The attached patch should fix this bug.

AttachmentSize
imagefield_import-591494-1.patch 683 bytes

#2

mojzis - October 22, 2009 - 10:19
Status:needs review» needs work

I tested this and I think it still needs some polish, I guess the trouble is when the requested path doesn't exist ? The imagefield moduel itself does create, but not this one :(

#3

wulff - November 21, 2009 - 12:26
Version:6.x-1.4-beta1» 6.x-1.x-dev
Status:needs work» fixed

This has been fixed in the latest development version of the module.

 
 

Drupal is a registered trademark of Dries Buytaert.