acdh-oeaw / apis-core-rdf

APIS Core refactored
https://acdh-oeaw.github.io/apis-core-rdf/
MIT License
3 stars 3 forks source link

background object creation failing in relation form #1397

Open b1rger opened 3 hours ago

b1rger commented 3 hours ago

So I'll create a separate issue for the background object creation failing and close this one. Thanks for the answers!

Originally posted by @gythaogg in https://github.com/acdh-oeaw/apis-core-rdf/issues/1364#issuecomment-2470491829

This refers to the autocomplete not giving appropriate feedback if the creation of an object did not succeed

gythaogg commented 2 hours ago

Thank you, this is correct - my new issue tab is still in draft as I was investigating the slightly different ways in which many to many fields record creation in forms failed and wasn't sure if I should report different issues or a common one.

gythaogg commented 2 hours ago

This one I mean #1363 - didn't have time to check if the root cause is the same as this one.

b1rger commented 2 hours ago

Thank you, this is correct - my new issue tab is still in draft as I was investigating the slightly different ways in which many to many fields record creation in forms failed and wasn't sure if I should report different issues or a common one.

no problem, its a complicated matter as I just found out myself ;)

This refers to the autocomplete not giving appropriate feedback if the creation of an object did not succeed

so actually this is only about the relations form autocomplete. If the other autocompletes have a Create ... option and the create fails, it shows an error message, but that error message is not really helpful. I've created #1398 to make this error message bit more meaningful. For the relations autocomplete, this error message (which is returned by the autocomplete endpoint in the error field of the JSON response) somehow does not show up. I guess thats (again) a problem with our custom reinit_select2 event listener

b1rger commented 2 hours ago

I guess thats (again) a problem with our custom reinit_select2 event listener

we probably have to copy the success function: https://github.com/yourlabs/django-autocomplete-light/blob/45a9ff6e95e58348b90b3c1f01f01cb6ca10b4d3/src/dal_select2/static/autocomplete_light/select2.js#L128