Closed mstenta closed 6 months ago
Regarding:
- Create a View that loads the information we need to build the crop plan.
I tested this quickly, and found that there is more we need to do in order to be able to build this View.
Basically, we use a combination of hook_farm_plan_record_relationships()
and hook_views_data_alter()
to describe to Views the relationships between the farm_plan
table, the farm_asset
table, and our custom farm_crop_plan_plantings
table.
However, it doesn't appear that the relationships we need are described yet. We need to be able to create a View of planting assets, and then add a "Relationship" to the plan via the farm_crop_plan_plantings
table (joining farm_asset.id
to farm_crop_plan_plantings.planting_id
columns). I thought that relationship was covered, but I will need to look closer to see why it isn't available.
Also curious: I'm not sure if the logic we have in farm_plan_views_data_alter()
can properly handle database tables that contain multiple references, as we are doing in this module (we include planting_id
, seeding_id
, and transplanting_id
in the same row).
One other thought that came up based on feedback from Cora at Wolfe's Neck, which could be enabled with Views Bulk Operations:
We’re probably a ways away from this, but editing multiple entries at once would be super convenient. Not quite sure how this could work. For example, adding the same note to multiple logs. I guess that would maybe be checking multiple and then adding an observation log?
If all of the "rows" are Views results, it is conceivable that we could add a bulk action checkbox next to each one, and provide the same buttons at the top/bottom that we do on the Assets > Plantings page, for performing bulk operations on all plantings in a plan.
Might want a separate issue for that, but leaving it as a comment here for now.
Might want a separate issue for that, but leaving it as a comment here for now.
Created a separate issue :-)
We are in the process of porting this module to farmOS v3, and moving it to https://www.drupal.org/project/farm_crop_plan, along with any open issues that are still relevant.
We can reassess needs in the new version and see if any of these same ideas still apply.
In #13 we identified some performance issues encountered as the number of plantings in a plan increases.
I think the steps to do this would be (roughly):
farm/plan/%