Create the hook_updat_N to set the default value of the new field "Background Color"

Created on 18 February 2023, over 1 year ago
Updated 19 February 2023, over 1 year ago

Problem/Motivation

We create the new field "Background Color" at πŸ“Œ Add the missing "Background Color" into global settings form Fixed so now we need to create a hook_update_N to set the default value of this field #0d77b5. With that the users that already have the ebt_core installed, they'll update, and on hook_update the new field will be populated with the new default value #0d77b5 automatically. Example:

renatog@macbook:$ lando drush updb

 ---------- ----------- --------------- -------------------------------------------------------------------------------------- 
  Module     Update ID   Type            Description                                                                           
 ---------- ----------- --------------- -------------------------------------------------------------------------------------- 
  ebt_core   9101        hook_update_n   9101 - Set the new field "ebt_core_background_color" with default value = '#0d77b5'.  
 ---------- ----------- --------------- -------------------------------------------------------------------------------------- 


 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > yes

>  [notice] Update started: ebt_core_update_9101
>  [notice] Update completed: ebt_core_update_9101
 [success] Finished performing updates.
renatog@macbook:$ 

Proposed resolution

Implements the hook_update_N that'll load the config object editable, set the default value for the new field "Background Color" and save the object

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

1.4

Component

Code

Created by

πŸ‡§πŸ‡·Brazil RenatoG Campinas

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

Comments & Activities

Production build 0.69.0 2024