Undefined variable 'arg' in core/modules/views/src/Plugin/views/argument_validator/None.php

Created on 16 October 2015, over 9 years ago
Updated 2 February 2023, about 2 years ago

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

Solution : Line 31 - Replaced with $argument variable.

🐛 Bug report
Status

RTBC

Version

10.1

Component
Views 

Last updated about 9 hours ago

Created by

🇮🇳India krknth

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

Merge Requests

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 about 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 about 2 years ago
  • 🇺🇸United States smustgrave

    Opened 📌 Re-evaluate numeric validator Postponed: needs info

  • Status changed to Needs work about 2 years ago
  • Merge request !11279Add numeric back to None → (Open) created by quietone
  • 🇳🇿New Zealand quietone

    Convert to MR and updated it for the latest comments.

  • 🇺🇸United States smustgrave

    feedback appears to be addressed

  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • First commit to issue fork.
  • Pipeline finished with Success
    22 days ago
    Total: 422s
    #463980
  • 🇺🇸United States dcam

    Rebased.

  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    We need to update the issue summary. I think we need to consider the correctness of the code and what it should be doing. Also the issue summary is incorrect - there's no PHP notice about an undefined variable anymore.

    I've tried to work out why but unfortunately this code was added to views before the great CVS migration so it is seriously old code.

    For me the big question here is why do we have this code at all. My guess is that if the argument is numeric then this is some very basic validation we can do. We should have a comment that indicates this in the None plugin.

Production build 0.71.5 2024