File: /www/htdocs/sites/all/modules/contrib/views/plugins/export_ui/views_ui.class.php
    Line 383: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();


File: /www/htdocs/sites/all/modules/contrib/views/plugins/views_wizard/views_ui_base_views_wizard.class.php
    Line 572: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($display_options['default']['fields'] as &$field) {
    }


File: /www/htdocs/sites/all/modules/contrib/views/views.api.php
    Line 1170: [Warning] Nested by-reference foreach loop, make sure that array modifications (if any) do what you expect
    foreach ($condition_group['conditions'] as &$condition) {
    } 
CommentFileSizeAuthor
#4 views-3006201-4.patch2.27 KBalt.dev
#3 views-3006201-3.patch2.55 KBalt.dev

Comments

StephenRobinson created an issue. See original summary.

stephenrobinson’s picture

Issue tags: +PHP 7.0 (duplicate)
alt.dev’s picture

StatusFileSize
new2.55 KB

During the update of our project to the PHP7, we found several places where warnings with 'Illegal string offset' text appeared and these warnings caused some issues. Analyzing the views module we found that its code contains some 'Illegal string offset' problems as well. I attach a patch which fixes these warnings.

alt.dev’s picture

StatusFileSize
new2.27 KB

My bad. Attached wrong file :(

damienmckenna’s picture

Version: 7.x-3.20 » 7.x-3.x-dev
Status: Active » Needs work

I don't see how these comments would cause these errors? Drupal 7 doesn't care about comments.

stephenrobinson’s picture

I have found with php7 'Illegal string offset' means some code does this:

$foo['bar']['baz']='something';
where $foo['bar'] has not been defined as an array, so tends to need:

If(!is_array($foo['bar'])){
  $foo['bar']=array('baz'=>'something');
}
else{
  $foo['bar']['baz']='something';
}

jweowu’s picture

The first item (quoted below) is addressed in #3016530: Relocate calls to func_get_args() to beginnings of functions.

File: /www/htdocs/sites/all/modules/contrib/views/plugins/export_ui/views_ui.class.php
    Line 383: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();
marc.groth’s picture

FWIW the following issue has been raised which addresses the first problem: https://www.drupal.org/project/views/issues/3076826

After applying the patch from the aformentioned ticket on version 7.x-3.23 of the module; there are no more errors related to <= PHP 7.2.

joseph.olstad’s picture

Status: Needs work » Postponed (maintainer needs more info)

I've been using PHP 8.1 with the latest release of views for quite some time and have even tried it with PHP 8.2 and have not seen these PHP 7.0 issues.

I'm guessing this is an outdated issue.

possibly can close this.

Strangely enough the patch still applies but shouldn't actually change anything as it's only changing comments.