Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Attached patch is the result from a PhpStorm code inspection for undefined variables analysis only focused on the core/modules/views/src/Plugin/views tree
The patch is not ready as it needs some expert review.
Settings:
Report contains:
Undefined variable 'arg'
Variable 'options' might have not been defined
Variable 'sort_options' might have not been defined
Variable 'custom_format' might have not been defined
Variable 'custom_format' might have not been defined
Variable 'custom_format' might have not been defined
Variable 'custom_format' might have not been defined
Variable 'custom_format' might have not been defined
Variable 'custom_format' might have not been defined
Variable 'custom_format' might have not been defined
Variable 'custom_format' might have not been defined
Variable 'source' might have not been defined
Variable 'identifier' might have not been defined
Variable 'identifier' might have not been defined
Variable 'identifier' might have not been defined
Variable 'source' might have not been defined
Variable 'identifier' might have not been defined
Variable 'source' might have not been defined
Variable 'identifier' might have not been defined
Variable 'identifier' might have not been defined
Variable 'source' might have not been defined
Variable 'exposed_filters' might have not been defined
Variable 'sort_field' might have not been defined
Variable 'sort_table' might have not been defined
Variable 'value' might have not been defined
Variable 'value' might have not been defined
Variable 'group_types' might have not been defined
Variable 'id' might have not been defined
Variable 'groups' might have not been defined
Variable 'default_field' might have not been defined
Variable 'table' might have not been defined
Variable 'plugin_name' might have not been defined
Variable 'plugin_name' might have not been defined
Variable 'options_name' might have not been defined
Variable 'raw_items' might have not been defined
Variable 'offset_seconds' might have not been defined
Variable 'offset_seconds' might have not been defined
Variable 'offset_seconds' might have not been defined
Undefined variable 'matches'
Comment | File | Size | Author |
---|---|---|---|
#1 | Inspections.png | 28.01 KB | clemens.tolboom |
plugin-views-undefined-vars.patch | 13.94 KB | clemens.tolboom | |
Comments
Comment #1
clemens.tolboomAdded screenshot for settings and list of report.
Comment #2
clemens.tolboomComment #4
dawehnerThis is indeed a bug
The value is a timestamp
Sorry but I don't see a value in this inline comments, do you?
I would like to have a dedicated issue to test the groupwise max relationship properly, to be honest.
Well, the idea is indeed to use the last used $id, maybe wrap this with if isset($id) ?
use just NULL;
Comment #5
tim.plunkettComment #14
LendudeNot sure how to proceed here. Pretty sure we are not just going to update this without adding test coverage for the changes, but stuff like #4.1 still lives in core today, so don't just want to close this. I am going to change this to a task. Anything that is an actual bug, should probably be spun off into its own issue so we can get test coverage for that going.
Comment #15
clemens.tolboom@lendude maybe best is to report #4.1 as a new issue plus a task for better static analysis xref here then close this one?