I am not sure if I should open this issue here or in Automatic Nodetitles module. I am using an Exif Token for the automatic title of my node, in my case the Token is:

[node:field_image_caption]

... which picks up the iptc_caption data from my image.

On saving a node for the first time, the automtically generated title does not appear but if I run: drush exif-update, then the generated title does appear. However on subsequent node saves, the title then goes away again.

I tried the very same thing but using a built in Drupal token such as: [node:author] and it works as expected, I can do subsequent node saves and the title does not get deleted. I know this is probably an edge case so I am not sure how complicated this would be to find the cause and fix. Thanks.

Comments

Danny Englander’s picture

Just following up on this issue, thanks.

griz’s picture

If anyone else is struggling with this you can use Rules.
Import this rule, changing "photograph" for your node type. I have it set to use the file name but you could also change that.

{ "rules_update_title_from_file_name" : {
    "LABEL" : "Update title from file name",
    "PLUGIN" : "reaction rule",
    "TAGS" : [ "exif" ],
    "REQUIRES" : [ "rules" ],
    "ON" : [ "node_insert", "node_update" ],
    "IF" : [
      { "node_is_of_type" : {
          "node" : [ "node" ],
          "type" : { "value" : { "photograph" : "photograph" } }
        }
      },
      { "entity_has_field" : { "entity" : [ "node" ], "field" : "field_computed_filename" } }
    ],
    "DO" : [
      { "data_set" : { "data" : [ "node:title" ], "value" : "[node:field_computed_filename]" } },
      { "entity_save" : { "data" : [ "node" ], "immediate" : 1 } }
    ]
  }
}
Danny Englander’s picture

@griz, I am just curious what this rule does, does it run drush exif-update on node save? It sounds like a work around to me and not a fix for the module but might be good in the short term until this gets fixed.

jphautin’s picture

Assigned: Unassigned » jphautin
jphautin’s picture

Category: Support request » Feature request
Issue summary: View changes
Status: Active » Fixed

Hello,

For Drupal 7.x :

  1. create a field with a exif widget to extract the data (by example : exif_filename to be sure to have a value)
  2. install *Automatic Entity Labels* module
  3. enable Automatic Entity Title in your entity and use the pattern "[node:field_exif_filename]"
  4. hide the field_exif_filename from the default display

For Drupal 8.x:
For now, (2016/11), there is no *Automatic Entity Labels* module available. So the last development version of exif is doing the work alone. Just use a exif widget on the title and it will work. I could eventually backport on 7.x branch but I think this is not necessary as Automatic Entity Labels Module is doing the job.

regards,

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.