The screen-dump below is from this issue #2762705: Slick view and Drupal 7.50 new issue.

Screenshot

Notice that the version number given in the sidebar top right is "7.50", but the version number that appears in the editable metadata is "7.5".

As you can see from the comments Fabianx corrected the version number in #2. The correction is registered, but the change does not "stick". When another comment is added it is bumped back to "7.5" again (unless the commenter explicitly corrects it to "7.50").

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gisle created an issue. See original summary.

David_Rothstein’s picture

I seem to remember something like this happening with Drupal 7.40 too... at least I think. So I would guess there is some code somewhere which is evaluating these numerically and thinks "7.50" and "7.5" are the same thing.

drumm’s picture

Assigned: Unassigned » drumm

Looking into this, it can be reproduced with 7.40.

drumm’s picture

Title: Issue tracker version number not "sticky" » List (text) field should use stricter comparison
Project: Drupal.org customizations » Drupal core
Version: 7.x-3.x-dev » 7.x-dev
Component: User interface » text.module
Assigned: drumm » Unassigned
Issue tags: +affects drupal.org

I can reproduce this with a fresh copy of Drupal core.

  • Create a List (text field).
  • Set the allowed values to 7.50, 7.5.
  • Create content using with 7.50.
  • Somewhere PHP’s loose comparison goes into numeric mode and the edit page select 7.5.
drumm’s picture

Version: 7.x-dev » 8.2.x-dev

I can reproduce this in 8.2.x-dev too.

drumm’s picture

The markup ends up as

<option value="7.50" selected="selected">7.50</option>
<option value="7.5" selected="selected">7.5</option>

Browsers go with the last selected option. This confirms it is a PHP issue.

For Drupal.org, I’ll hold off building, and maybe even deploying, a fix since this is a bit of an edge case, the -dev versions are preferred anyway. See also #2691889: Add option to remove tagged releases from the version selector.

David_Rothstein’s picture

Issue tags: +Needs backport to D7
cilefen’s picture

I just did a lot of debugging and the bug is in form_select_options().

cilefen’s picture

Status: Active » Needs review
FileSize
733 bytes

Status: Needs review » Needs work

The last submitted patch, 9: list_text_field-2762953-9.patch, failed testing.

cilefen’s picture

The last submitted patch, 11: list_text_field-2762953-11-TEST.patch, failed testing.

drumm’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

drumm’s picture

Title: List (text) field should use stricter comparison » Select elements should use strict comparison
Component: text.module » forms system

More-accurate title since this is a Form API issue.

alexpott’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

in_array() really should default to TRUE - classic PHP mistake. Nice find and and nice test!

Committed and pushed 2893aec5df3d95fd6e4da2401cd8aa661045c13a to 8.2.x and 2280ea7 to 8.1.x. Thanks!

Setting as 'patch to be ported' till the Drupal 7 backport issue is open.

  • alexpott committed 2893aec on 8.2.x
    Issue #2762953 by cilefen, gisle, drumm: Select elements should use...

  • alexpott committed 2280ea7 on 8.1.x
    Issue #2762953 by cilefen, gisle, drumm: Select elements should use...
cilefen’s picture

cilefen’s picture

Status: Patch (to be ported) » Fixed
Issue tags: -affects drupal.org, -Needs issue summary update, -Needs backport to D7
cilefen’s picture

Be aware, the same simple fix breaks TaxonomyTermTestCase::testTermInterface in D7, which incidentally tests multiselect list options with integer keys, so those field types may not have the test coverage they need and this may not be releasable.

cilefen’s picture

Status: Fixed » Active
Issue tags: +Needs tests
FileSize
662 bytes

This probably needs a revert and new test coverage. This patch explains why.

cilefen’s picture

Status: Active » Needs review

  • alexpott committed 00b6a1f on 8.2.x
    Revert "Issue #2762953 by cilefen, gisle, drumm: Select elements should...

  • alexpott committed ffa9493 on 8.1.x
    Revert "Issue #2762953 by cilefen, gisle, drumm: Select elements should...
alexpott’s picture

Took the safe route and reverted...

  • alexpott committed 00b6a1f on 8.3.x
    Revert "Issue #2762953 by cilefen, gisle, drumm: Select elements should...
  • alexpott committed 2893aec on 8.3.x
    Issue #2762953 by cilefen, gisle, drumm: Select elements should use...

  • alexpott committed 00b6a1f on 8.3.x
    Revert "Issue #2762953 by cilefen, gisle, drumm: Select elements should...
  • alexpott committed 2893aec on 8.3.x
    Issue #2762953 by cilefen, gisle, drumm: Select elements should use...

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • alexpott committed 00b6a1f on 8.4.x
    Revert "Issue #2762953 by cilefen, gisle, drumm: Select elements should...
  • alexpott committed 2893aec on 8.4.x
    Issue #2762953 by cilefen, gisle, drumm: Select elements should use...

  • alexpott committed 00b6a1f on 8.4.x
    Revert "Issue #2762953 by cilefen, gisle, drumm: Select elements should...
  • alexpott committed 2893aec on 8.4.x
    Issue #2762953 by cilefen, gisle, drumm: Select elements should use...

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

drumm’s picture

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs review » Closed (outdated)
Issue tags: +Bug Smash Initiative

I tested this on a fresh install of the standard profile on Drupal 7.90-dev and 9.4.x. I followed the steps in #4 and was not able to reproduce the problem. I don't know when it was fixed, just closing as outdated.

If that is wrong, reopen and explain what needs to be done.

Thanks