Allow editing of "Notification interval" options

Created on 23 March 2018, over 7 years ago
Updated 1 March 2024, over 1 year ago

Currently, we're using a list_integer base field with fixed options for the "Notification interval" of saved searches.
While that gives us most of the functionality we need out-of-the-box, it doesn't seem possible this way to let the admin configure the set of options (or the default), or set it to a fixed interval. (It's possible, via the field UI, to hide the field from users, but it's apparently not possible to change the default value, so all saved searches would be stuck at "Never".)

This definitely has to be amended, but I'm not familiar enough with the Field API yet to know how to best resolve this. (This is my first "actual" content entity type, I think.)

We can override the base fields per-bundle, but that won't make them configurable either โ€“ we'd have to provide the whole form UI for changing the default and options ourselves, like in D7. Which would be a possible solution, but a bit disappointing since configurable list_integer fields have already the exact functionality we need (although I guess the "Fixed interval" solution would be a bit makeshift in this case).

There are also "base field override" config entities, which users can create themselves to override existing base fields. Since I think they don't have a UI yet (i.e., you'd have to manually write the config and import it), this is not really proper UX. Also, it seems you can't override all the settings that way. (I was able to change the default value, but not the options, this way. But maybe I did something wrong.)

Finally, we could remove the base field completely and just provide a field storage config and field instance configs per default for all saved search types. I guess that would work pretty well in general, but then we couldn't rely on the field being present anymore โ€“ we'd have to disable notifications when the field is removed for a certain type. (Or switch to some default behavior.) Or can we add a dependency on that field instance config from the type? (Since that would be circular, I guess not. Also, we may not want to.)

Anyways, input from people more familiar with the Field API would be very much welcome!

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฆ๐Ÿ‡นAustria drunken monkey Vienna, Austria

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024