Issue 77: Workaround for JSON:API error for localgov_review_date field#81
Issue 77: Workaround for JSON:API error for localgov_review_date field#81Polynya wants to merge 3 commits into
Conversation
stephen-cox
left a comment
There was a problem hiding this comment.
This works fine for my initial testing. I have only tested the needs review functionality on a basic site, so not tried it with the JSON:API or multilingual content. But it doesn't break current functionality.
|
Chatting about this at merge Tuesday and not sure who the best person to test this is. @ekes was wondering is @joachim-n had an opinion on the best way to do computed fields like this so they're available for specific bundles. |
|
According to https://www.drupal.org/project/computed_field/issues/3353839, bundle fields defined in code don't show in jsonapi output. I'm not sure what's needed to fix this - https://www.drupal.org/project/drupal/issues/3252278 is the core issue. |
|
@Polynya could you check this one and resolve merge conflicts? Also, happy to help test, if you can tell me what I need to do. |
|
This also works to fix the issue with #77 I was having with entity share |
|
This looks like something we should work on, but we've let slip a little bit. Anyone fancy picking it up again to
|
|
I've fixed the git conflict. I've confirmed that this doesn't break our current functionality and have used this approach when adding another field used by workflows here: Ideally this should also be tested by someone with the who's using the JSON:API with LocalGov Drupal, but we could just agree this is a better approach. |
|
The failing test here is Looking I can't say I'm any the wiser. Probably one for someone who knows this better to check. |
This is my workaround which uses hook_entity_base_field_info() instead of hook_entity_bundle_field_info(). This adds the field to all bundles so they are hidden on non-scheduled bundles with a form alter.