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

Add entity paths to schema & APIv4 #18887

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Oct 30, 2020

Overview

This adds metadata to some entities (hopefully more will be added in the future) for the paths at which they can be created/updated/viewed/deleted. The metadata is accessed via the DAO, and exposed to APIv4.

Technical Details

Entity paths can be used to construct a url to create/view/edit/update a given entity.
The paths are local and contain tokens which would need to be replaced, e.g. [id] or [contact_id].
The token name corresponds to the field name who's value is required.

Comments

This kind of thing has been tried before. Six years ago, @totten created CRM_Utils_System::createDefaultCrudLink() which had a similar ambition to provide links for many entities. Sadly it never really got off the ground, and to-date still only supports 1 entity (Contacts). I considered extending that instead of striking out with a new initiative, but that function was heavily coupled to the DAO and could only generate links to existing entities. I needed something more flexible that could provide url templates for any entity supported by the API, without requiring a live DB connection to run.

Entity paths can be used to construct a url to create/view/edit/update a given entity.
The paths are local and contain tokens which would need to be replace, e.g. [id] or [contact_id].
The token name corresponds to the field name whos value is requred.
@civibot
Copy link

civibot bot commented Oct 30, 2020

(Standard links)

@eileenmcnaughton
Copy link
Contributor

@colemanw I think this would stop that fail #18892

@eileenmcnaughton
Copy link
Contributor

unrelated fail

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

Successfully merging this pull request may close these issues.

2 participants