I am trying to set up a content type with an image field. The path for the images should be something like contenttype/[node:terms:first]. But there are no replacements for node terms like that although these exits in the path aliase of pathauto in the node edit screen.
Is there a way to get this working for content type configuration?

Comments

grossmann’s picture

I tried the http://drupal.org/project/filefield_paths module and could select a [node:terms:first] token in the path config of the content type. But when I saved the node I got this error.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node-9-12-field_tags-0' for key 1: INSERT INTO {taxonomy_entity_index} (entity_type, bundle, entity_id, revision_id, field_name, delta, tid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6), (:db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => article [:db_insert_placeholder_2] => 9 [:db_insert_placeholder_3] => 12 [:db_insert_placeholder_4] => field_tags [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 5 [:db_insert_placeholder_7] => node [:db_insert_placeholder_8] => article [:db_insert_placeholder_9] => 9 [:db_insert_placeholder_10] => 12 [:db_insert_placeholder_11] => field_tags [:db_insert_placeholder_12] => 1 [:db_insert_placeholder_13] => 7 ) in taxonomy_entity_index_field_attach_update() (line 155 of /var/www/web/drupal7/sites/all/modules/taxonomy_entity_index/taxonomy_entity_index.module).
The image was saved to the correct path (folder/token/image.jpg) but the record in the database file_managed URI pointed to the wrong path (public://folder/image.jpg).

marcoka’s picture

fyi, the filefield_paths is very buggy in the d7 version. it may be green but it should be red dev.

grossmann’s picture

Thanks for these information.
grossmann-mcs

cameron prince’s picture

Issue summary: View changes
Status: Active » Closed (outdated)