Problem/Motivation

Steps to reproduce

When a default value was set as a comma delimited string in the drupal settings, observe that selected UI values in the node edit preview are incorrectly set because they are being truncated. This is because SHS normally operates on an array of integers rather than a string.

Additionally, if a constraint validator is operating on the edit form this can result in a validation message that doesn't make sense.

Proposed resolution

Modify code in OptionsShsWidget so that if a default value was set as a comma delimited string in the drupal settings it is converted into an array of integers and the value is set correctly.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork shs-3277510

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

smiracle created an issue. See original summary.

smiracle’s picture

Issue summary: View changes
smiracle’s picture

Issue summary: View changes
smiracle’s picture

Title: Select list values incorrectly truncated in ContainerView.js » Select list values incorrectly truncated
Issue summary: View changes
b_man’s picture

Destroyed contents of images originally attached per the users' request.

smiracle’s picture

Issue summary: View changes
StatusFileSize
new759 bytes
dmitrypro77’s picture

kevin.dutra’s picture

Version: 2.0.0-rc2 » 2.0.x-dev
StatusFileSize
new1.08 KB
new1.13 KB

Safety check to make sure array item exists before trying to operate on it. Also adjusted to single quoted string literals, for consistency.

burnellw_cit’s picture

Version: 2.0.x-dev » 2.0.0-rc1
StatusFileSize
new1.08 KB

williamsona made their first commit to this issue’s fork.

williamsona’s picture

StatusFileSize
new935 bytes

I found the patch in #9 fixes the issue for 2 or more shs values but not if there is only a single value. I have combined what is in patch #9 with what is in the module.

rozzi’s picture

The issue is that previewing a node causes some field values to get reset, right? It's one I've experienced, but I'm not sure if it's the same issue.