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
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | incorrectly-truncated-values-3277510.patch | 935 bytes | williamsona |
| #9 | 3277510-shs-truncated-selected-value-9.patch | 1.08 KB | burnellw_cit |
| #8 | interdiff-7-8.txt | 1.13 KB | kevin.dutra |
| #8 | 3277510-shs-truncated-selected-value-8.patch | 1.08 KB | kevin.dutra |
| #7 | 3277510-shs-truncated-selected-value-2.patch | 1.01 KB | dmitrypro77 |
Issue fork shs-3277510
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 #2
smiracle commentedComment #3
smiracle commentedComment #4
smiracle commentedComment #5
b_manDestroyed contents of images originally attached per the users' request.
Comment #6
smiracle commentedComment #7
dmitrypro77 commentedComment #8
kevin.dutra commentedSafety check to make sure array item exists before trying to operate on it. Also adjusted to single quoted string literals, for consistency.
Comment #9
burnellw_cit commentedComment #12
williamsona commentedI 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.
Comment #13
rozzi commentedThe 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.