New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move transplant_days field to farm_transplant module #795
Conversation
769a482
to
5acb307
Compare
This change also includes an update hook that will uninstall the field ONLY IF there is no data in the |
Perhaps the only hanging thread here are the This branch removes I'm not sure if there is a good solution for this, and this may be why we decided to keep This reminds me of https://www.drupal.org/project/farm/issues/3190851. I do sort of wish we had taxonomy term bundle plugin support, but adding that would be a breaking change at this point. |
With all of that in mind, it may mean we shouldn't merge this PR, if it causes more trouble than it solves. I wanted to open it to get thoughts from others at least... perhaps there's another solution out there. |
5acb307
to
9b0039a
Compare
9b0039a
to
23ba2b3
Compare
23ba2b3
to
dc94c89
Compare
dc94c89
to
01c40ae
Compare
I rebased this onto #806, which resolves this issue. This PR is ready for review now. |
In testing this with a few different scenarios I discovered an issue with the update hook... testing a fix for it now... |
01c40ae
to
09ce774
Compare
OK I fixed the update hook. It now handles a few different cases pretty elegantly, I think: If there is any If there is NO There is still a failing test, so I'll look into that now... but otherwise this seems to be working. |
Ah this was because the |
09ce774
to
227cea2
Compare
227cea2
to
47de686
Compare
47de686
to
ee183af
Compare
Currently the
farm_plant_type
provides aplant_type
taxonomy. Theseplant_type
terms have a few fields added to them:crop_family
- reference to a term in thecrop_family
vocabularycompanions
- reference to one or more terms in theplant_type
vocabularytransplant_days
- integer representing the number of days between seeding and transplantingmaturity_days
- integer representing the number of days between seeding and maturity/harvestI am also proposing we add
harvest_days
to represent the "harvest window" in #794. (This PR is currently built on top of that that one, but we can separate them if we need to.)My though behind moving
transplant_days
to thefarm_transplant
module is: not all farms deal with transplants. A farm that only deals with direct seeding may not have thetransplant
log type installed, and thistransplant_days
field is meaningless to them.By moving it to the
farm_transplant
module, this field will only be installed when that module is.