No values were changed. "validateForm"

Created on 12 May 2022, about 2 years ago
Updated 1 October 2023, 9 months ago

Problem/Motivation

When saving custom processors form options, the validateForm incorrectly marks them as "No values were changed".

Steps to reproduce

Create a set of options in a processor plugin that php would consider "equal" ( == ) but not "identical" (===)
For example: ['option1'=> 'option1', 'option2' => 0] != ['option1'=> 0, 'option2' => 'option2'] returns false although values have changed.

Proposed resolution

Use identical operator in validation.
https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/src/Form/In...

๐Ÿ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Plugins

Created by

๐Ÿ‡ณ๐Ÿ‡ฑNetherlands Willempje2

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ฆ๐Ÿ‡นAustria drunken monkey Vienna, Austria

    For example: ['option1'=> 'option1', 'option2' => 0] != ['option1'=> 0, 'option2' => 'option2'] returns false although values have changed.

    It doesnโ€™t seem like that is true.

  • Status changed to Active 9 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands Willempje2

    Not sure if link works or if you want to support PHP 7 but does seems to be true for PHP 7.4.33
    https://3v4l.org/QMF0j#v7.4.33

  • Status changed to Closed: won't fix 9 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡นAustria drunken monkey Vienna, Austria

    Ah, OK.
    Well, since PHP 7 has been EOL for almost a year, and the last Drupal version to even theoretically support it will follow in a month, I donโ€™t think itโ€™s worth it to fix this now. Still, thanks for reporting, and please feel free to re-open if you have any good examples that fail on PHP 8 as well.

Production build 0.69.0 2024