[current-page:title] seems to be generating:

<em>Edit contenttype</em>page title

instead of just "page title" like I would expect.

Comments

Dave Reid’s picture

Component: Token Actions » Code
Status: Active » Postponed (maintainer needs more info)

The token is returning the result from drupal_get_title() so it's up to other modules and code to set it properly. Can you maybe expand a little bit more about what use case you are trying to use the token for?

glide’s picture

Sure.

I created a content type "meeting" is has several file fields used to store the presentations given at the meeting.

To organize things I specified things like "[current-page:title]/posters" for the file directory to store them.

When I add content of this type I get directories like these:

drwxr-xr-x.  6 apache apache      4096 May  1 09:33 <em>Edit Meeting<

which then contains:

drwxrwxr-x.  7 apache apache 4096 Feb 13 14:56 em> 2011 Annual (Fall) Meeting

Which then actually contains my desired sub-directories.

[root@internal em> 2011 Annual (Fall) Meeting]# ls -la
total 28
drwxrwxr-x. 7 apache apache 4096 Feb 13 14:56 .
drwxr-xr-x. 6 apache apache 4096 May  1 09:33 ..
drwxrwxr-x. 2 apache apache 4096 Jan  9 17:00 info-sharing
drwxrwxr-x. 2 apache apache 4096 Jan  9 16:18 other-documents
drwxrwxr-x. 2 apache apache 4096 Dec  2 15:51 posters
drwxrwxr-x. 2 apache apache 4096 Dec  2 15:56 sponsor-presentations
drwxrwxr-x. 2 apache apache 4096 Dec  2 14:24 technical-review

The <em> Edit Meeting </em> would be bad enough, but the / in the </em> is messing up the paths even more.

Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Yeah I cannot recommend using that token in file directory configuration as it is not reliable. When the file is saved to the web server when uploaded, the current page is in fact the Add or edit page for the node, and the title is 'Edit '. This is the way the token works.

glide’s picture

But it didnt work this way in the past, this behaviour only started recently. I dont know exactly when becuase we only have these meetings twice a year, but it was fine in November.

"Meetings" I created up until November 30, 2011 worked as I expected. Sometime after that something changed.