Skip to content
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

APIv4 - Add managed entity functionality #21955

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Nov 1, 2021

Overview

Provides extra API functionality which will be used by the SearchKit UI to display searches as "packaged" with a "Revert" button.

Technical Details

This new "ManagedEntity" trait provides 2 extra fields (has_base & base_module) and a Revert action to facilitate UIs which show the managed state and a revert button, similar to the AfformAdmin UI. Any DAO-based entity can opt-in to this functionality simply by using the trait.

The base_module field provides the name of the extension in which an entity is packaged. It will be useful in the Afform UI as well, so I implemented a version of that field in the Afform::get API here: #21960.

Comments

This PR includes test for the new fields & action, and existing API test coverage is good.

@civibot
Copy link

civibot bot commented Nov 1, 2021

(Standard links)

@civibot civibot bot added the master label Nov 1, 2021
@colemanw
Copy link
Member Author

colemanw commented Nov 1, 2021

retest this please

@seamuslee001
Copy link
Contributor

@colemanw

error in building test site

31
+++ pushd /home/jenkins/bknix-dfl/build/core-21955-1oqp7/web/sites/default
+++ drush -y updatedb
No database updates required                                           [success]
+++ drush -y en civicrm toolbar locale garland
toolbar is already enabled.                                                 [ok]
The following extensions will be enabled: civicrm, locale, garland
Do you really want to continue? (y/n): y
API_Exception: [0]: Authorization failed                                 [error]

@colemanw
Copy link
Member Author

colemanw commented Nov 1, 2021

The unit tests I spot-checked locally all passed. But this PR appears to cause a crash during install; I'm quite puzzled as to why.

@seamuslee001
Copy link
Contributor

@colemanw it seems it is failing on this line now https://github.com/civicrm/civicrm-core/pull/21955/files#diff-701bf6b7f7ec53672fcbc98be0650bdbb881e0fdd427ba4eb3474e4e1751d691R633 maybe something to do with Entity Permissions?

@seamuslee001
Copy link
Contributor

This new "ManagedEntity" trait provides 2 extra fields and a Revert action
to facilitate UIs which show the managed state and a revert button,
similar to the AfformAdmin UI.
@colemanw
Copy link
Member Author

colemanw commented Nov 2, 2021

I broke the offending commit into its own PR to facilitate tracking down that test failure. This PR is now passing except for some unrelated failure noise from Jenkins. Anyone want to give it a merge?

@seamuslee001
Copy link
Contributor

Test fails unrelated and this seems fine to me merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants