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

Command icon 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

RenatoG created an issue. See original summary.

renatog’s picture

Status: Active » Needs review
levmyshkin’s picture

Status: Needs review » Postponed
levmyshkin’s picture

Hi Renato, we have these code in massageFormValues():

foreach ($values[0]['ebt_settings']['link_options'] as $key => $option) {
  $values[0]['ebt_settings'][$key] = $option;
}

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.

levmyshkin’s picture

We 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.

renatog’s picture

#5 clarified and really makes sense. Thanks a lot