If the File Destination Directory is using a token, like [node:title] and the value of the token has a & character in it, the directory that is created has &amp in the name.

Tokens return sanitized values. Looks like you need a decode_entities() around the token_replace call in file_entity_upload_destination_uri(). Similar to the issue #1987568: Alt and Title Text ". Patch forthcoming.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mpotter’s picture

Status: Active » Needs review
FileSize
512 bytes

Here is the patch. Pretty simple one.

dehacker’s picture

This patch works for my instance of OA 2.19. File directory names now use '&' instead of entity '&amp' when creating directories from file path upload tokens.

I also tested the & with space/section naming issue for select lists and the update in OA 2.19 and sites will need the patch that is expected in the next OA release (2.23?) to fix that apparently.

mpotter’s picture

Status: Needs review » Reviewed & tested by the community

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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