Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.Similar to #2709425: Implement field_extra_fields() for hosting_site, _platform, and _server. but for hook_entity_property_info, it would be nice if we implemented this because then the Entity API would know about all our custom properties that we're adding to nodes, and then other modules could make use of them easily.
For example, I want to use SearchAPI to search for sites within the Aegir UI, but can't surface any useful fields to it because they're all unknown as far as Search API is concerned.
Patch to follow.











Comments
Comment #2
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedPatch attached for review (and also in dev/2730603-hook_entity_property_info).
Just has an implementation for the site nodes at the moment.
Comment #3
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedHere's the patch for platforms (again, also in git).
Comment #4
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedAnd for servers.
Comment #5
clemens.tolboomI've merged the patches into one to not waste time next time :p
I only found the server part patch (sick!)
The repo could use #2741809: Clean up repo branching ;-)
Comment #6
clemens.tolboom@Steven Jones please describe your testing.
I cannot find the 'new' fields
- create a rule to see the fields
- create a view to see the fields
None succeeded.
Below my hosting_task code (no patch as I don't want to derail this issue)
Comment #7
Steven Jones CreditAttribution: Steven Jones at ComputerMinds commentedThanks for testing!
I was using search API to do the 'testing'.
Comment #8
clemens.tolboomI 'found' the 'bug' regarding my tasks fields not popping up.
- Entity has field X does not show the fields
- Set a data value (task:task-type) is available but is not writable
tbc
Comment #9
clemens.tolboomThis is now a blocker for #2603704: Add action to create a new task
I've added my task part. Not I use hosting_task_entity_property_info_alter
To fix for #2603704: Add action to create a new task and in general for using Rules setting values we need to add the setters classes too.
@Steven I guess we need to use hook_entity_property_info_alter. What do you think?
Comment #10
clemens.tolboomI puzzled a little more for using rules too.
To fix the setter for task_type adding a setter callback unblocks mentioned error in #8.
task_status needs some input (what are the integer values and their meaning?)
task_arguments seems to need the type struct but https://www.drupal.org/node/905580 states
Note I use hook_entity_property_info_alter
Lastly I still cannot get the value for task_type in a rules condition.
Comment #11
clemens.tolboomSo now I managed to generate a task through rules.
Comment #12
clemens.tolboom[edit]Moved to #2603704: Add action to create a new task[/edit]
Comment #13
clemens.tolboom[edit]Moved to #2603704: Add action to create a new task[/edit]
Comment #14
helmo CreditAttribution: helmo at Initfour websolutions commentedTo test I created a rules component that creates a flush cache task.
This seems to work.
I should probably create an issue in the https://www.drupal.org/project/aegir_rules queue to start adding these there.
Comment #15
clemens.tolboom@helmo guess we can move our rules examples over to issue #2603704: Add action to create a new task
Comment #16
Jon PughThis looks good, but I haven't tested it out.
Ideally we finish the hosting task arguments before committing, but what if we just remove the hosting task arguments until it's ready?
If we finish or remove the hosting task argument, and someone else runs a decent test on it, we can mark it RTBC.
Great work!
Comment #17
Jon PughPlease leave the code, just comment it out. That way who ever picks it up from there doesn't have to start over.
Also, please change FIXME to @TODO.
Thanks!
Jon
Comment #19
helmo CreditAttribution: helmo at Initfour websolutions commentedI've committed this with the 'FIXME' part disabled.
Lets continue in #2758635: Add task node metadata for arguments