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

Created on 18 February 2023, almost 2 years ago
Updated 19 February 2023, almost 2 years 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.71.5 2024