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

The services API can not consume what it puts out #2196

Closed
fmizzell opened this issue Oct 25, 2017 · 2 comments
Closed

The services API can not consume what it puts out #2196

fmizzell opened this issue Oct 25, 2017 · 2 comments
Assignees
Labels

Comments

@fmizzell
Copy link
Contributor

fmizzell commented Oct 25, 2017

If you retrieve a dataset with the API, and then try to save it as a new dataset, the API will not be able to save it. Most of the errors are related to reference fields.

In particular the dataset reference field in a resource is validated by the API with an entity_reference_autocomplete validator which expects the title of a node instead of a node id. Other fields may have the same problem.

@fmizzell fmizzell self-assigned this Oct 25, 2017
@fmizzell
Copy link
Contributor Author

Update: Ok, so the problem is not only around entity_reference fields that use autocomplete. Some list fields also break node creation.
There is a services hook that allows us to do some modifications to the data before it is process by services. I attempted a correction there without success. I modified the data to comply with the expected structure in the field validation functions, but the values where still not being saved.

My current thinking is that we should figure out a way to have a little more control over field validation so we continue to get the benefits that services gets from submitting a form instead of dealing with the entity system directly while being able to remove validations that break the datastore API.

I will attempt that by overriding the services callbacks for node create and update (at least for the dataset and resource nodes) and deal with the entity system directly, while bringing some form (widget) field validation selectively into play.

@kimwdavidson kimwdavidson changed the title The services API can not consume what it puts out Disocovery: The services API can not consume what it puts out Nov 1, 2017
@kimwdavidson kimwdavidson changed the title Disocovery: The services API can not consume what it puts out Discovery: The services API can not consume what it puts out Nov 1, 2017
@kimwdavidson
Copy link

This ticket is for investigation and creating new tickets to address work.

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

No branches or pull requests

4 participants