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.
The fields should be able to be altered during export, for example, term reference field, user may set default value for a field instance, but the default value(term id) can be different from development to production environment, in this case, we need to alter the default value during export/rebuild, a good solution is use uuid_features together.
Comment | File | Size | Author |
---|---|---|---|
#10 | 2158049-10-features-pre-post-invoke-alter-hooks.patch | 567 bytes | hanoii |
#7 | features-field_export_alter-2158049-7.patch | 2.49 KB | kristiaanvandeneynde |
Comments
Comment #1
rogical CreditAttribution: rogical commentedComment #2
rogical CreditAttribution: rogical commentedComment #3
rogical CreditAttribution: rogical commentedre-roll patch with code cleanings
Comment #4
rogical CreditAttribution: rogical commentedComment #5
rogical CreditAttribution: rogical commentedComment #6
kristiaanvandeneyndeSeems to make sense, especially given the example implementation here: #2158057: UUID support for default value in taxonomy term reference field settings
Although, I could be wrong, isn't $pipe already exposed through hook_features_pipe_COMPONENT_alter()?
Comment #7
kristiaanvandeneyndeStill needs the hooks added to features.api.php, so patch not complete yet.
Comment #8
hefox CreditAttribution: hefox commentedI don't really like "one off" type things -- I'd prefer if every feature component had an alter hook or none at all. too bad features hooks are done in such a way can't add this via one place, sigh...
Comment #9
hanoiiI am also in the need for this, and maybe worth adding something that has a patch rather than nothing, but if all or nothing is wanted, what's missing for all, is it too hard to add? If there are any pointers I can add it.
Comment #10
hanoiiWhat about the approach followed by this patch?. It's more of a guess-work patch, pretty harmless though, but should be more in-line with the all or nothing approach.
Comment #11
mpotter CreditAttribution: mpotter commentedCan somebody give me a good use-case for this. I hate to add even more hooks like this. The case in #6 is already handled in the Features UUID integration module I had thought. The Features Override module also uses existing alter hooks to modify features. We had this discussion early in the Features Override development and had strong feelings against adding more alter hooks rather than using existing hooks.
So I really want to hear a valid use-case where existing hooks are not enough.
Comment #12
kristiaanvandeneynde#2158057: UUID support for default value in taxonomy term reference field settings
This use case allows you to export term reference field instances with the default term's UUID instead of TID. This does not work out-of-the-box in UUID Features, because the hook to allow this isn't available yet. This issue is to ask for the addition of said hook.
Disclaimer: I haven't checked UUID Features since I "fixed" my project with both patches, so I can't guarantee it is still not a part of said module.
Comment #13
hanoiiAs far as I understood, Features UUID was missing some hooks to do what @kristiaanvandeneynde saids, changing tids by UUIDS on every place. Personally I wanted uuids for terms in both default term information for fields and also exporting tac_lite configurations, it seemed that's not currently possible with the current hooks but I admin I haven't looked at this that extensively.