-
Notifications
You must be signed in to change notification settings - Fork 8
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
Carry over default fields when creating a new alert banner type #108
Comments
Would Entity:CreateDuplicate be the right method? https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21EntityInterface.php/function/EntityInterface%3A%3AcreateDuplicate/8.9.x |
@Iam-Jam fancy looking? |
@andybroomfield I've just taken a look at this but I'll need some more context before I can make a suggestion\work on it... Is the functionality provided by the module the module dependent on the Link, Short description and Type of alert fields, from what I can see in the source I would suggest that it is to a certain extent, if so then I would suggest managing these fields as 'base fields' that way they would exist for all bundles and we can guarantee their existence. If in fact we really do want these fields to be optional, i.e. admins can delete them after creating a new bundle, then I suspect we'll want to extend the |
Worth saying that if we go with base fields then we're probably going to have to think about a migration path for installations which use the field base\instances... |
Hi @Iam-Jam They are meant to be managed fields in config, as there are use cases where those fields are not present. They are definalty optional (but suggested) fields for new banner types. The issue is that when creating a new banner, it would be better to have them present by default and allow site builders to delete them, instead of site builders having to re-add these fields, if that is something that is possible. If not I would continue with as we have now, keeping these fields as config. |
* Added Condition Field module (#137) * Added visibility field (#137) * Patch condition_field for missing schema: https://www.drupal.org/project/condition_field/issues/3215202 * Copy configuration for visibility field to new alert banner types (#137 #108) * Only use the request_path plugin for controlling banner visibility. Includes update path for field_condition schema. See: https://www.drupal.org/project/condition_field/issues/3215202#comment-14117352 * Added update hook to add visibility field to existing alert banners * Add visibility field to all existing localgov_alert_banner bundles Co-authored-by: Andy Broomfield <andy.broomfield@brighton-hove.gov.uk>
Currently when a site builder creates a new alert banner type, they get the stripped down version of title, and the display control checkboxes.
The extra fields such as kind of alert and link are not avalible by default (they can be added as fields).
Would a better starting point be to carry over the same fields as the default alert banner type, such as when using bundle copy.
This is partly due to moving the fields into config, which would be better kept, however there should be a way of duplicating fields from an entity.
Localgov alert banner
New alert banner type.
The text was updated successfully, but these errors were encountered: