FileField Paths currently only works with file fields on nodes. The Drupal 7 version should support file fields on at least comments, or preferably any entity type.

Comments

mfb’s picture

Status: Active » Needs work
StatusFileSize
new3.62 KB

Well here's the quick-hack way to get this to work.. I needed to migrate some legacy data into comment file fields and this did the trick. Of course a proper patch would have to involve further re-architecting..

mfb’s picture

Started working on a bigger patch to support this but haven't gotten very far yet. Figured I should upload what I have so far, just a schema change.

Aleanar’s picture

When does FileField Path support the taxonomy filefield ?

h0tw1r3’s picture

h0tw1r3’s picture

sweetchuck’s picture

I was close two other issue with duplicated. (Join forces :-) )
http://drupal.org/node/1217732
http://drupal.org/node/1243680

I am working on this issue, but the patch is not ready yet.

maximpodorov’s picture

@Sweetchuck, when do you plan to publish the patch? I started to work on this also, but if you're almost ready, I'd prefer to stop.

sweetchuck’s picture

@maximpodorov, we need to discuss the new API. I would like to support that fields where not just one FID is stored.
Although most common used fields (file, image) store only one FID. But if somebody create a new field type with two or more FID (fid1, fid2, fid3, …) with separated file_directory settings filefield_paths cannot support that.

Now not too easy to add new cleanup methods. (tolower, pathauto, transliterate). I would redesign this part too.

My questions are:
Why necessary the {filefield_paths} database table?
And not exactly clean to me how the retroactive update works. Why need two checkboxes (Retroactive update, Active updating)

sweetchuck’s picture

StatusFileSize
new87.71 KB

Here is an ultra very development version :-)
This is just a concept. Lot of works need.
I temporary remove some features, such as batch update, and text field value rewrites.
But (maybe) work with any entity types, and with any file reference field. Not just with the "file" and "image" fields.
Please send feedback.

maximpodorov’s picture

Does it update existing data in filefield_paths table?

sweetchuck’s picture

Not. If this direction will be approved, then need to write the update hooks.
I do not want unnecessary work.

michelle’s picture

I ran into this issue with Profile2 and ended up filing a dupe issue because I didn't know this was a more general problem. So adding in some search candy: Profile and Profile2 and imagefield paths on Profile2 entities

There, hope that helps the next Profile2 user. :)

Michelle

Canadaka’s picture

subscribing. Waiting until this supports fields on profiles

pascalduez’s picture

Subscribing - I was trying to make it work with a custom entity, no luck...
For reference: this means at the actual state it does not work with file fields attached to entities created with modules like eck, field_collection, etc.
I'm gonna test the patch in #9

andreasb’s picture

Subscribing, just stumbled across this and would love to see FileField Paths to support entities (especially when it comes to translations).

zabelc’s picture

Subscribing, I just came across this issue

deciphered’s picture

Status: Needs work » Fixed

Latest dev supports all entity types (that I've tested), with the exception of field_collection, but that will be remedied.

michelle’s picture

Thanks!

Michelle

maximpodorov’s picture

Status: Fixed » Active

The latest dev doesn't work for taxonomy term entity.
Looks like the latest dev doesn't work even for nodes. The files are not renamed when saving nodes.
No, the problem for nodes is Filefield Paths settings were lost after upgrading to the latest dev. I had to reconfigure node fields, and now files are renamed. But the problem with taxonomy terms is not fixed.

deciphered’s picture

Status: Active » Fixed

Issue with Taxonomy terms and other Entities (including Field Collections) is now fixed and committed.

Nodes already worked, it's just a case of needing an upgrade path, and given this is still a dev then I don't see the upgrade path yet to be necessary. It will be in place before the next stable release though.

maximpodorov’s picture

I confirm it works for taxonomy terms. But term tokens are not available for FileField Paths. Is it possible to add them?

deciphered’s picture

You are correct, tokens are not yet Entity aware, this does need to be fixed but I would ask that you open another issue for this.

maximpodorov’s picture

pascalduez’s picture

Tested the latest dev against custom entities created with Entity Construction Kit (ECK), seems to works well.
Thanks a lot @Deciphered for taking the time to commit all those changes.

gmclelland’s picture

Thanks @Deciphered, didn't realize how much I needed this module until I didn't have it.

Status: Fixed » Closed (fixed)

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

zabelc’s picture

Status: Closed (fixed) » Needs work

I hate to say it, but I think this patch missed a data migration step.

I had previously setup paths and names images in most of my content types, but now when I go to the settings page for that field I find that it has returned to the default.

Looking at the filefield_paths table, I understand why: in the type column I see two different sorts of entries content type only for all the fields I had set previously, and "node::" entries for the fields I've gone back to correct.

As another note, I also see entries for content types I've since deleted.

deciphered’s picture

Status: Needs work » Closed (fixed)

That's unfortunate that it was missed, but the module is still just in beta/dev and issues like this may occur. I will try to prevent such issues in the future.

However, please don't re-open closed issue, instead create a new issue and reference this issue if you believe it is related.

Prancz_Adam’s picture

Issue summary: View changes

Any update with Profile2 file entities support?