Rewrite plugin doesn't replace replacement pattern on File ID

Created on 18 November 2020, over 4 years ago
Updated 17 July 2025, 19 days ago

I am attempting to import nodes via a CSV -- all the fields are importing fine except for an image field. The CSV has a column labeled "photo," which contains the filename of an externally hosted image, e.g. "profile_pic.jpg", and I am attempting to use the rewrite tamper plugin to append the absolute url to the parent directory for the image. However, the [_photo] replacement pattern is not being replaced by the row's value during import.

  1. I map photo column to the File ID of an image field called "Profile picture", and set it to Reference by file Id.
  2. I then create a rewrite tamper plugin for photo -> Profile picture: File ID
  3. I set the replacement pattern to http://example.com/img/profile-picture-uploads/[_photo]. [_photo] is included in the plugin's list of "Available replacement patterns"
  4. When I attempt to run the import, I receive the error message of "The file, http://example.com/img/profile-picture-uploads/[_photo], failed to save because the extension, _photo], is invalid."

Note that when I attempt use other patterns, e.g. http://example.com/img/profile-picture-uploads/[_last_name]_[_first_name].jpg, it does substitute the values properly.

πŸ› Bug report
Status

Closed: duplicate

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States hipp2bsquare Temple, New Hampshire

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024