I have the latest version of Drupal, Pathauto and FFP installed and I have my path configured to
[node:content-type]/[node:title]-[node:nid] However When saving files FFP does not replace spaces with "-" as in my pathauto setting, which is casing problems with my node template

I know there are no maintainers for the D7 version, if someone could tell me where the path renaming is implemented I can try and fix it myself (Although thats assuming that I can fix it)

Comments

Tim Jones Toronto’s picture

Hi,

Had the same situation. Try after line 589 (e.g. on Dev version)

Locate where it has: $value = drupal_strtolower($value);

Just after this line add this code: $value = str_replace(" ", "-", $value);

Don't forget to enable: Convert to lower option in FFP.

Hope it helps!
Tim

dreadlocks1221’s picture

worked well on retro update, thanks =^.^=

Tim Jones Toronto’s picture

Cool :)

michelle’s picture

Worked for me as well. Thanks!

Michelle

samtherobot’s picture

I'm not sure the thinking behind have a setting called "Pathauto" that never actually calls or references the module pathauto. Perhaps this just hasn't been finished yet.

I would think there needs to be a fairly simple block of code in the filefield_path_process_string function like this:

if (module_exists('pathauto') && (isset($settings['pathauto']) && $settings['pathauto'])) {
  $value = pathauto_cleanstring($value);
}
sweetchuck’s picture

If you confugere the pathauto to remove . (dot) then you will lose the file extensions.
If you confugere the pathauto to remove / (slash) then you will lose the directory hierarchy.

oierbravo’s picture

Status: Active » Needs review
StatusFileSize
new877 bytes

Added code for cleaning up with pathauto.
It works like with the transliteration module, cleaning every part of the path separately so we don't lose directory hierarchy.

oierbravo’s picture

StatusFileSize
new832 bytes

fixed patch

marcoka’s picture

i tested #8 it and it seems to work.

marcoka’s picture

this does not seem the clean way to implement because in the latest dev there is already a check with a callback

line 557

'pathauto' => (module_exists('pathauto') && isset($settings['pathauto']) && $settings['pathauto'] && module_load_include('inc', 'pathauto')),

marcoka’s picture

Status: Needs review » Needs work
maximpodorov’s picture

StatusFileSize
new1.58 KB

This revised patch is applied to latest dev version. It keeps slashes and dots and respects pathauto punctuation settings.

deciphered’s picture

Status: Needs work » Needs review

Other than a few minor coding standard issues, the code looks sound enough, will give it a spin shortly and commit if I'm happy with it.

deciphered’s picture

Status: Needs review » Fixed

Committed to 7.x-1.x.

Thanks.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Adding info