Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Notice when using user field filter and enabled debugging #207

Open
golenkovm opened this issue Feb 24, 2022 · 0 comments
Open

PHP Notice when using user field filter and enabled debugging #207

golenkovm opened this issue Feb 24, 2022 · 0 comments

Comments

@golenkovm
Copy link
Contributor

Hi team,

It seems like there is a PHP Notice displayed on the view report page when debugging is turned on and user filter is used for the report:

Notice
:  Undefined offset: 1 in /var/www/site/blocks/configurable_reports/components/filters/fuserfield/plugin.class.php on line 174

As I can see preg_split() returns an array with only one element:

root@003b7cbe0a84:/var/www/site# cat my.php
<?php
var_dump(preg_split('/:/', 'Some string'));
root@003b7cbe0a84:/var/www/site# php my.php
array(1) {
  [0]=>
  string(11) "Some string"
}

So list($field, $operator) causes PHP Notice.

SQL used in my report:

select *
from prefix_user u
where
  1 = 1 
  %%FILTER_USERS:u.firstname%%
  %%FILTER_USERS:u.lastname%%

Cheers,
Misha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant