Problem/Motivation
When opening the form with the settings the "default" value wasn't being filled. For example, create a "ebt_bb" with option "open link in a new tab". Save that and edit the same block again. Is open to see that this field isn't checked.
Steps to reproduce
The field is being saved but the "default" value is trying to retrieve wrongly, without the "link_options" array in the key
Proposed resolution
Update the array key to include the "link_options" there
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork ebt_basic_button-3346138
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
renatog commentedMR with the fix: https://git.drupalcode.org/project/ebt_basic_button/-/merge_requests/18
Comment #4
levmyshkinComment #5
levmyshkinHi Renato, we have these code in massageFormValues():
It copies link_option to ebt_settings directly. Sites with existing blocks and old EBT Basic Button 1.3.x or old 1.4.x can't use new ['ebt_settings']['link_options'] values, because all old values are stored in ['ebt_settings'] directly. And they couldn't update module without loosing their settings. So site editors should resave all modules with current EBT Basic Button version and then we would apply your pull request. So I suggest to postpone these changes until 1.5.x version.
Comment #6
levmyshkinWe could create hook_update_n and go through all EBT Basic Button contnent and inline blocks and copy settings to 'link_options'.
Also we need to go through existing EBT Webform Popup and EBT CTA blocks, because they use the same Basic Button widget as parent.
Comment #7
renatog commented#5 clarified and really makes sense. Thanks a lot