IRC logs for #farmOS, 2020-12-24 (GMT)

2020-12-23
2020-12-25
TimeNickMessage
[19:15:01]* lauriexwayne[m] has joined #farmos
[19:16:26]<lauriexwayne[m]>Thanks for the invite jgaehring!!! Nice to see you farmOS team and friends - I'm visiting from the Open Food Network.
[22:00:18]<symbioquine[m]>Is there a better way to save new areas than `taxonomy_term_save`? I was surprised to find that it doesn't seem to enforce the [allowed_values_function](https://github.com/farmOS/farmOS/blob/92f854b9be271e06f2e005f14d64653eb4...)...
[22:07:37]<paul121[m]>hmm yea, as far as I know the `allowed_values` are only used to provide options. there might not be anything that enforces those options when saving
[22:08:16]<symbioquine[m]>There is when saving the area form...
[22:08:35]<symbioquine[m]>If I hack up the html to add a new option to the select dropdown it fails to save
[22:08:46]<paul121[m]>sorry, thinking in the entity API level
[22:09:04]<symbioquine[m]>ACTION uploaded an image: image.png (27KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/upDqpyypjUsSxrUo... >
[22:09:38]<symbioquine[m]><paul121[m] "sorry, thinking in the entity AP"> Yeah, that's what I'm looking for... just seems surprising that the validation would only apply to the UI.
[22:10:27]<symbioquine[m]>Through the API I can put any value I want and it saves without complaint;
[22:10:30]<symbioquine[m]>ACTION uploaded an image: image.png (3KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/hbCrIQPHRARrXaPK... >
[22:21:14]<paul121[m]>wouldn't be surprised if there's a contrib module that provides that... especially worth considering for 2.x!
[22:21:38]<paul121[m]>theres a few fields that use the `allowed_values`, would be good to have those enforced over the API
[22:22:25]<paul121[m]>I noticed that they are NOT included in the JSONAPI schema (pretty sure I checked this) which is a bummer
[22:22:40]<paul121[m]>but a worthwhile contribution
[22:23:30]<paul121[m]>I'm learning that the D8 JSONAPI is quite connected to the entity model beneath it... so if the entity api had the concept of the allowed values, then JSONAPI likely would too
[00:20:02]* svenn has quit (Ping timeout: 260 seconds)
[00:20:17]* svenn has joined #farmos
[02:16:48]* svenn has quit (Ping timeout: 268 seconds)
[02:19:34]* svenn has joined #farmos
[04:01:31]* svenn has quit (Read error: Connection reset by peer)
[04:03:01]* svenn has joined #farmos
[05:29:31]<mstenta[m]>symbioquine paul121 : I *believe* Drupal 8/9 may handle validation via the API - D7 definitely was lacking in that area - but from what I understand validation is on the Entity API level now... rather than having to be implemented at both the Form API and REST API levels
[06:47:00]<mstenta[m]>(and notably, D7 didn't have any concept of "REST API" - that was an add-on module - everything is more tightly integrated now)
[10:30:42]<paul121[m]>cool! we'll have to test that out