Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After setting [image-derivative] in "File path:" at admin/settings/image/nodes , its not included after import of photo. Place is empty. Same with file name. Am i missing something ?
I observed that when i make Retroactive update, the image-derivative data get into path but than i get 404 for any image.
Thanx for any help.
Comment | File | Size | Author |
---|---|---|---|
#66 | 578442-features.patch | 7.14 KB | mfb |
#60 | 578442-features-export.patch | 7.11 KB | mfb |
#56 | 578442_2_minor_fix.patch | 812 bytes | szantog |
#52 | 578442_features_export.patch | 11.43 KB | szantog |
#50 | 578442-export-rerolled.patch | 8.1 KB | szantog |
Comments
Comment #1
szczym CreditAttribution: szczym commentedAlso happens with stable version
Comment #2
szczym CreditAttribution: szczym commentedAfter some testing on fresh install i thing its bug.
Comment #3
Deciphered CreditAttribution: Deciphered commentedPlease provide brief step-by-step instructions on what you are doing so that I can attempt to reproduce and confirm the issue.
Comment #4
Deciphered CreditAttribution: Deciphered commentedClosed due to lack of response.
Comment #5
colanTo reproduce:
I would expect that the "File path" would be carried over, and not be reset.
Comment #6
TravisCarden CreditAttribution: TravisCarden commentedNote: Similar settings retention issue at #849778: Filefield Paths settings not carried over when adding existing field to new content type.
Comment #7
KarenS CreditAttribution: KarenS commentedThe path is stored in a table and no information about the path is added to the export, thus nothing gets done when you try to import it somewhere else. This also affects the ability to use filefield paths in features, since there is no way to export the value into a feature.
Currently there is no way to do this other than manually writing custom code to update the filefield_paths table with the new information.
Comment #8
q0rban CreditAttribution: q0rban commentedThere are a few separate issues about CCK exports being broken when using this module:
- #814328: How can i export the filefield paths configuration to other site?
- #849778: Filefield Paths settings not carried over when adding existing field to new content type
I'm going to mark those as duplicates of this issue.
I propose implementing ctools export.inc to add exportability coupled with Features integration. Possible downsides of this are a dependency on ctools, and CCK exports done outside of Features still being broken. We may be able to create the patch in a way that it doesn't require export.inc for the module to still function as is.
Thoughts?
Tagging issue as well.
Comment #9
q0rban CreditAttribution: q0rban commentedOk, here's my first take at a patch. This definitely needs lots of testing, b/c there are some architectural changes going on here.
Comment #10
q0rban CreditAttribution: q0rban commentedWhoopsie.. Take 2 that doesn't remove one of the translation files. ;)
Comment #11
Deciphered CreditAttribution: Deciphered commentedHi q0rban,
Thanks for getting involved, I do really appreciate it.
However, the first thing I am going to say may or may not blow away your desire to continue to provide your support (and I really hope it doesn't): CTools dependency is out of the question.
It's nothing personal to CTools itself, I have high great respect for merlinofchaos, he is a far greater developer than I could ever be and I'm sure the code in CTools is some of the best code on the Drupal scene. I do have an issue with adding another barrier to users by adding unnecessary dependencies.
I know this complicates matters, and is a royal pain for you or anyone else trying to supply this functionality.
My quick thoughts on FileField Paths exportables, after a quick read of this thread last night, on how to bring exportables to FileField Paths are:
- Create a modules/features.inc for all the code (this is just my standard process).
- Use Features hooks to simply dump at FileField Paths columns as an array as required.
- Use 'hook_features_populate_alter()' #693024: Add alter hooks for the "faux" exportables to detect when exported Content Types are using FileField Paths settings and add dependency on FileField Paths and exportable object. (And hope that this hook makes it in, because it is greatly needed).
- Use one of the non-exportable hooks from Features to re-add the data back into the database on installation of the Feature.
Take into account that this is just off the top of my head with only a few minutes thought, but the concept should work and it shouldn't take more than 3 or 4 hooks with minimal code to be achieved.
Happy to discuss alternatives, and I do still intend to look through your patches more thoroughly, but I really can't think of a valid reason to add CTools as a dependency as 99% of the users are unlikely to ever need to export the settings (huge assumption).
Cheers,
Deciphered.
Comment #12
TravisCarden CreditAttribution: TravisCarden commented@q0rban has marked as a duplicate of this issue #849778: Filefield Paths settings not carried over when adding existing field to new content type:
Let's make sure it gets addressed as well.
Comment #13
colanWhat if CTools were optional, rather than a dependency?
Comment #14
q0rban CreditAttribution: q0rban commented@#12, Whoopsi! I think I misread that when I marked it as duplicate. I think that is indeed a separate issue. :)
Comment #15
Deciphered CreditAttribution: Deciphered commented@colan
Optional requirements aren't really an option as it's just as confusing.
In my personal opinion, Features should supply the hooks to define exportables as it is the module that requires the exportables, or it should require CTools.
As this is not the case, I don't think CTools exportables are the way to go, but as I mentioned above it should be just as easy to allow exportable FFP settings without CTools.
I will turn attention back to FFP as soon as I have finished up the next stage of development on a couple of my other modules, but I am more than happy to work with anyone who wishes to help out, especially those who provide patches.
Cheers,
Deciphered.
Comment #16
q0rban CreditAttribution: q0rban commentedHere's an updated patch that only depends on ctools for exportability. I *REALLY* think we should stick with ctools for this because it seriously saves us hundres of lines of code, not to mention that we then have the features module maintaining the ctools integration. Features is still somewhat in the 'wild wild west' phase, so this saves the maintainers of this module from having to keep up with any changes that may occur there.
Plus, all the cool kids are doing it! Seriously though, pretty much every DevSeed module that now defines it's features exportability by using cTools export.inc. Context 3 has moved to ctools, Strongarm 2 is ctools, Feeds, the list goes on and on. I think we can feel pretty good about requiring ctools for any exportability.
Comment #17
q0rban CreditAttribution: q0rban commentedWhoops, found a typo in a defined variable.
Comment #18
KarenS CreditAttribution: KarenS commentedFeatures does not require CTools but there are many things you can't do without it so for all practical purposes you need it. This is the standard method of creating Features exportables, it makes sense to do things the same way all other Features modules do rather than inventing a new way of doing things. It will also make the code easier for others to help maintain if we do it the 'standard' way in case the Features API changes in the future.
I think it makes sense to make it optional for people who don't want to use Features -- if CTools is available there is a Features exportable, otherwise there is not. So long as nothing is broken if CTools is disabled, it should have no ill effects on anyone. A note on the project page can mention that Features exports are provided if CTools is installed. Anyone who uses Features will have no trouble understanding that.
Comment #19
Deciphered CreditAttribution: Deciphered commentedI will consider this argument, and try to make some time to review the patch, but I do have to take exception to at least one thing, you say that this approach saves hundreds of lines of code, whereas I still stick by the fact that this functionality can be done with a few small functions without altering the database with a lot less code than these patches are using.
The concept is really quite simple as these are simply settings, not true exportable objects. Simply dump out the data on Features export and re-import in on Feature activation. Not really much to it at all.
The only place it does become an issue is when we aren't talking features exporting, we're talking standard CCK export/import (as this issue was started on), and I don't believe that either of these approaches take that into account.
I know it may look like I'm trying to take the easiest way out, and maybe I am, but my plan has always been that when I did have time to turn back to FFP it would be a complete rewrite leading to version 2.0, in which I would be more agreeable to such drastic changes.
I will try to catch you (q0rbon) on IRC to chat further, but as discussed via email, there is definitely a timezone clash.
Cheers,
Deciphered.
Comment #20
NicolasH CreditAttribution: NicolasH commentedsubscribing
Comment #21
jaydub CreditAttribution: jaydub commentedsubscribing
Comment #22
tlattimore CreditAttribution: tlattimore commentedSub.
Comment #23
davidburnssubscribe
Comment #24
blakehall CreditAttribution: blakehall commentedSubscribe.
The patch in #17 is working for me :)
Comment #25
andrewlevine CreditAttribution: andrewlevine commentedThe ctools/features support patch is good, but is there any reason the settings for this module can't be saved in say...content_field_instance instead of a separate table? I think that is probably the ultimate solution (exportable by features and cck and no dependencies).
Comment #26
q0rban CreditAttribution: q0rban commentedFYI, use the patch in #17 with caution, as I found a find/replace error in it after the fact but did not have the time to fix:
Whoops! :( Someone who has the time should walk through this with a fine-toothed comb and make sure there aren't other find/replace mistakes like this and re-roll the patch.
Comment #27
Deciphered CreditAttribution: Deciphered commentedJust a quick note, this is now an issue for me (yes, that is how it works) so it will definitely be fixed.
But do please be patient, I don't have a lot of time to work on Drupal lately.
Cheers,
Deciphered.
Comment #28
Deciphered CreditAttribution: Deciphered commentedFileField Paths 2.x (currently in development) is going to drop support for all non-CCK fields, which in turn allows it to take advantage of hook_widget_settings_alter() and have CCK handle all of the FileField Paths settings, which in turn means that exporting the CCK field (both using CCKs Export and Features Export) will export the data without any extra work involved.
Apologies to q0rban who put a lot of great work into this patch only to meet resistance, I do appreciate the effort, I just needed to decide exactly how I planned to approach this issue first, and unfortunately the end result was incompatible with the existing work you did.
Expect a dev/alpha/beta release by the end of the week (hopefully), as so far the re-write has gone extremely smoothly.
Cheers,
Deciphered.
Comment #29
q0rban CreditAttribution: q0rban commentedThat sounds *fantastic*!
Comment #30
Deciphered CreditAttribution: Deciphered commentedTagging
Comment #31
xurizaemonSub. (Now I see what you meant by "dropping support for non-CCK modules". Cool.)
Comment #32
joelstein CreditAttribution: joelstein commentedSubscribing.
Comment #33
chrisshattuck CreditAttribution: chrisshattuck commentedSubscribing, glad to see this moving forward. :)
Comment #34
dkinzer CreditAttribution: dkinzer commentedSubscribing
Comment #35
bfroehle CreditAttribution: bfroehle commented~
Comment #36
dman CreditAttribution: dman commentedHere is support for Features import/export with no dependancy on ctools.
This against DRUPAL-6--1-4. ALL NEW CODE IN ITS OWN INC FILE - so no conflicts are going to happen. Should apply to -dev also if you want to try.
I did it while working through a deployment Features package where I wanted to add filefield_paths support to my CCKs.
It will attach itself to any features export when you bundle a content type or an individual field.
You can also do it on its own, but that's pretty pointless out of context.
Done without reference to the earlier ctools version :-}, I just scratched an itch as practice getting ready to deploy whole sites as features, so I jumped in before I came looking to see if it had been attempted.
However, I also feel a bit icky about ctools - I haven't quite got its idea or API, but Features is really happening.
On review of #17 I see a lot of similarity, though it's using different API.
Does NOT address the discussed desire to get it into the base CCK export itself. Not sure where that should/could happen.
If you are still not at all interested, that's fine, it was just a fun little project for myself, but I can't see the discussed 2.x dev from September to compare with. It can even be grabbed and run stand-alone if anyone needs it.
Comment #37
Deciphered CreditAttribution: Deciphered commentedJust for reference, you can find the FFP 2.x branch at http://drupal.org/node/937890
I may yet consider committing this patch in the short term, because I also equally agree that this is a necessity.
Comment #38
tancThanks dman, patch in #36 works nicely.
Comment #39
lucio.ferrari CreditAttribution: lucio.ferrari commentedHallo,
I'm currently using filefield_paths on 27 cloned sites, which I manage by deploying custom scripts with drush. Since I'm not using 'features' the patch above was useless to me, but I found a (very rough) way to copy ffp settings when exporting/importing content types.
Basically, to copy a content type from a 'mother' site to its clones, it works like this:
I tried a solution using filefield_paths.module functions, but I failed.
Now, this code seems to work on my test site, but I don't know whether there are other db fields (e.g, variable?) which should be changed as well, so any hint would be greatly appreciated, before I make a mess.
Regards
L.F.
Comment #40
imp7 CreditAttribution: imp7 commentedModule settings being exportable is something that I wish every module would consider in its design. Features are impressive however not everything is supported and I want to use this on programatic ubercart products in an install profile. So I have no choice to write a new function and insert to the db like lucio.ferrari.
This might help someone not wanting to copy the serialized arrays. I guess the other thing that maybe helpfull would be calling;
Would also like to know if there is something lucio.ferrari and I have overlooked?
Cheers :)
Comment #41
lucio.ferrari CreditAttribution: lucio.ferrari commentedThat's much more elegant, my kudos. :-)
Comment #42
helmo CreditAttribution: helmo commentedsubscribing, I just installed the 2.x-dev and my initial tests look good :)
Comment #43
Boobaa#36 works for me; would be welcomed in a new release -- I'm not too ninja enough to RTBC it, though.
Comment #44
Itangalo CreditAttribution: Itangalo commented#36 works for me; would be welcomed in a new release. I'm also no ninja, but I guess two no-ninjas can replace a ninja. :-)
Comment #45
Deciphered CreditAttribution: Deciphered commentedWill test it out shortly, and if it works I will try to get it into a release as I my schedule won't allow for a proper re-write for at least another few months and I also need this functionality.
Comment #46
dkinzer CreditAttribution: dkinzer commentedThe patch looks real good, and works here too.
Comment #47
dman CreditAttribution: dman commentedRE the patch - I believe (and intend) that the sub-functions labelled as CRUD could be merged back into the module proper, for better architecture. Not strictly necessary, but a small improvement IMO.
Comment #48
szantog CreditAttribution: szantog commentedThe hook_features_pipe_component_alter(&$pipe, $data, $export) {} doesn't need $module_name. It could make the same error like this.
I've rerolled the patch against latest remotes/origin/6.x-1.x, and delete the unusable CVS keyword from new file.
Comment #49
szantog CreditAttribution: szantog commentedand attach
Comment #50
szantog CreditAttribution: szantog commentedThe first CVS patch cosed some whitespace error. Fixed (I hope..)
Comment #51
Deciphered CreditAttribution: Deciphered commented@szantog
Gave it a quick test, findings are as such so far:
- All functions should be in 'modules/features.inc', which is loaded when the features module is present (see filefield_paths_init()).
- filefield_paths_features_api() shouldn't need to declare the 'file' argument as the file will always be included if you do the above.
- 'Active updating' setting doesn't get exported.
Haven't finished testing yet, but in general it looks like it's on the right direction.
Comment #52
szantog CreditAttribution: szantog commentedOk, I just simple apply the patch previously reviewed. :)
Now, i made some changes:
1. As @dman in #47, the CRUD was moved in .module
2. Move .inc to modules/
3. Remove file argument from _features_api()
4. Add ffp_[type]_[field] variables to export 'Active updating'.
5. Add dependencies transliteration and pathauto, if the settings need it.
Comment #53
Deciphered CreditAttribution: Deciphered commented@szantog @dman,
I personally disagree with the placement of the CRUD functions in the .module file, firstly because it just adds extra clutter to the .module file, where my style is about grouping specific functionality together, not sticking it all in one place, and secondly because the functions are only required for the Features functionality.
Maybe in the future, during the development of FileField Paths 2.x it would make sense to make the functions available to the module as a whole, but for the simple purposes of adding Features support to the 1.x branch I would prefer to keep them in the features.inc file.
Other quick feedback, the 'hook_features_api' function should be in the features.inc file as well, everything Features should be in this file, the only file in this patch should be the features.inc file.
Haven't tested the actual functionality, but will do so as soon as I post this feedback. In the case that it is working I will re-arrange the code myself and commit this, otherwise I will let you know any further feedback.
Edit: Further feedback.
- in 'filefield_paths_item_features_export', what is the purpose of
$variable_map = features_get_default_map('variable');
? $variable_map doesn't get reference anywhere else.- Still isn't exporting 'Active updating'
Comment #54
Deciphered CreditAttribution: Deciphered commentedCommitted.
Thanks for the patience guys.
Comment #55
dman CreditAttribution: dman commentedgroovy
Comment #56
szantog CreditAttribution: szantog commentedYees. First I missed the ffp_[type]_[field] variable, and I knew, the features_get_default_map('variable') makes the strongarm api declaration. This is real unnecesary. That's a new patch.
- Still isn't exporting 'Active updating'
?? I created a new content type, then in create feature page I only choose the new content type, and every settings was added. I moved it to another site, and all settings was imported include the Active updating. I did it with existing feature by another content type, changed status of Active updating was moved successful.
Hmm And what about this issue? I see you edit your comment, but I don't know, before or after commit? :)
Comment #57
Deciphered CreditAttribution: Deciphered commentedYes, I did discover the problem before I committed, or else I wouldn't have committed. It's simply that the 'Active Updating' option requires 'Strongarm' to be present. I'm not entirely thrilled with that, but I can live with it as it's just for the one option.
Thanks for your great work.
Comment #59
mfbLooks like this still needs to be ported to Drupal 7.
Comment #60
mfbI've ported features.inc to drupal 7 and it seems to work in my testing.
Comment #61
dman CreditAttribution: dman commentedIt probably happened in the earlier roll-in, But I notice a search & replace has mangled the original comment :
... so, that line should be removed altogether :-)
Comment #62
aidanlis CreditAttribution: aidanlis commented@mfb can you roll the patch against 7.x-1.x and can someone mark as RTBC when you've tested it?
I believe Deciphered isn't too keen on this patch, but I'm happy to commit it once it's RTBC because:
a) The functionality is needed
b) When Deciphered finishes 6.x-2.x we can port that directly to 7.x-2.x making any changes to this branch irrelevant.
Comment #63
Deciphered CreditAttribution: Deciphered commented@aidanlis,
Actually, I did commit the 6.x version, after it was re-written to suit my coding style, so as long as it's a port of that I have no major concerns it being committed to 7.x-1.x, assuming it's well tested and is RTBC.
Cheers,
Deciphered.
Comment #64
aidanlis CreditAttribution: aidanlis commented@Deciphered Ah, awesome :) I'll check it before it goes in.
Comment #65
mfbThere is a problem with the field identifier in D7. I'd suggest changing the schema for filefield_paths to use entity_type, bundle and field_name as primary key, and then using the combination of all three as field identifier which is what features module expects.
Comment #66
mfbOK I think this is enough to resolve the actual problem: I added a hard-coded entity_type to the $key definition:
"node-{$row->type}-{$row->field}"
. See also #1155184: FileField Paths should support comments (and any other entities) with file fields for a proposal to support other entity types.Comment #67
ericacm CreditAttribution: ericacm commentedPatch from #36 works for me. Thanks!
Comment #68
Deciphered CreditAttribution: Deciphered commentedFixed and committed to 7.x-1.x.
Comment #70
roball CreditAttribution: roball commentedThe fix for 6.x-1.x is now officially available in version 6.x-1.5.