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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rogical’s picture

rogical’s picture

Status: Active » Needs review
FileSize
3.17 KB
rogical’s picture

FileSize
3.14 KB

re-roll patch with code cleanings

rogical’s picture

rogical’s picture

FileSize
3.14 KB
1.54 KB
kristiaanvandeneynde’s picture

Seems 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()?

kristiaanvandeneynde’s picture

FileSize
2.49 KB

Still needs the hooks added to features.api.php, so patch not complete yet.

hefox’s picture

Status: Needs review » Needs work

I 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...

hanoii’s picture

I 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.

hanoii’s picture

Status: Needs work » Needs review
FileSize
567 bytes

What 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.

mpotter’s picture

Status: Needs review » Needs work

Can 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.

kristiaanvandeneynde’s picture

#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.

hanoii’s picture

As 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.