I'm trying to use tokens in the file name, get "File Name must contain only letters, numbers, dashes (-) and underscores (_). And Site Tokens."

I've tried
[site:url-brief] [current-date:short]
site:url-brief current-date:short

Am I doing something wrong? Always like the way this worked in 7.x

Comments

pglatz created an issue. See original summary.

damienmckenna’s picture

Title: Tokens in file name cause error » Add token support to filename output
Version: 8.x-4.1 » 5.0.x-dev
Component: Code » User interface
Category: Support request » Feature request
Issue tags: +Needs tests

I'm not entirely sure that tokens are working in the filenames, so let's make sure they are.

larisse’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

Hi! I made a patch that ignore the error if Token module (that is necessary for use tokens) is installed. I think solve the problem.

hmendes’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new79.13 KB
new77.26 KB

Hello!
Tested patch from #3 and now is possible to save the filename with Tokens.
Moving to RTBC.

Tested on Drupal 9.1.8, 'Backup and Migrate' 5.0.x-dev and 'Token' 8.x-1.x-dev.

damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs tests
Parent issue: » #3143649: Plan for Backup and Migrate 5.0.0

I moved the $has_token_module line inside the if() statement, but otherwise this is perfect, thank you. Committed.

drumm’s picture

Updating to fix issue status cross-post.

Status: Fixed » Closed (fixed)

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