None validator incorrectly handles numeric arguments

Created on 16 October 2015, about 9 years ago
Updated 7 March 2023, over 1 year ago

Problem/Motivation

Hi,
Found undefined variable argument in core/modules/views/src/Plugin/views/argument_validator/None.php.

Steps to reproduce

Proposed resolution

Do not validate a 'numeric' plugin when the argument is not numeric.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Views 

Last updated about 11 hours ago

Created by

🇮🇳India krknth

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.

  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

    @quietone thanks for uploading a tests-only patch so can see that the fix indeed does work.

    The change made looks good. Agree checking if the number is_numeric makes all the sense in the world haha.

  • 🇬🇧United Kingdom catch

    However, I would have expected that a numeric argument would have the Numeric validator, not the None validator. Perhaps that is the underlying problem?

    I think that the None validator is used for literally everything, when no argument validation is set. So the problem is that without this code it would cause issues with the numeric validator. I think really it should not have to know which argument it's dealing with - i.e. why is it doing any validation at all if validation is set to none?

    Re-titling since the undefined variable was dealt with elsewhere already.

  • Status changed to Needs review almost 2 years ago
  • 🇬🇧United Kingdom catch

    I think we should open a follow-up for #72 - i.e. can we move plugin-specific code out of the None validator or at least better document why it's there.

  • Status changed to RTBC almost 2 years ago
  • 🇺🇸United States smustgrave

    Opened 📌 Re-evaluate numeric validator Postponed: needs info

  • Status changed to Needs work over 1 year ago
Production build 0.71.5 2024