I just upgraded an Aegir 2 server to Debian Wheezy, which comes with PHP 5.4. It throws a bunch of errors:

strict warning: Non-static method view::load() should not be called statically in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/views.module on line 1113.
strict warning: Declaration of views_handler_field::query() should be compatible with views_handler::query($group_by = false) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_sort::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_sort::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_sort::query() should be compatible with views_handler::query($group_by = false) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_filter::query() should be compatible with views_handler::query($group_by = false) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_relationship::query() should be compatible with views_handler::query($group_by = false) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_area::query() should be compatible with views_handler::query($group_by = false) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_area_text::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_plugin_query::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_bulk_operations_plugin_style::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Non-static method view::load() should not be called statically in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/views.module on line 1113.
strict warning: Non-static method view::load() should not be called statically in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/views.module on line 1113.
strict warning: Declaration of views_handler_argument::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_handler_argument::query() should be compatible with views_handler::query($group_by = false) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.
strict warning: Declaration of views_plugin_argument_validate::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /var/aegir/hostmaster-6.x-2.0-rc2/profiles/hostmaster/modules/views/includes/handlers.inc on line 98.

These all appear due to Views maintaining backward compatibility with PHP 4, and so they cannot be fixed.

To suppress these errors, we can drop something like the following into a local.settings.php:

  error_reporting(0);

Unfortunately, this turns errors off entirely, not just E_STRICT ones. So far, my attempts to find a way to only suppress E_STRICT errors via settings.php have been fruitless. I'm going to explore other options, but I'd love to hear from others who might already have fixed this.

CommentFileSizeAuthor
#8 views-estrict-2060727-8.patch18.97 KBnitishchopra
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ergonlogic’s picture

Status: Active » Needs review

I believe removing just E_STRICT via error_reporting() is not possible due to Drupal's custom error handler. There's a patch for Drupal 6.28 over in #1954296: Restore original D6 behaviour to prevent logging E_STRICT warnings that we should consider applying to core in our makefile.

ergonlogic’s picture

Adding such a patch would require us to specify a Drupal core version in our makefiles, so that Aegir doesn't break as soon as a 6.29 (or whatever version fixes this issue) comes out. I don't see any other way, though...

ergonlogic’s picture

Component: User interface » Install process
Category: support » bug
Status: Needs review » Postponed

Fixed in 6f0275f. We should revert this once it's fixed in core, so setting as postponed.

ergonlogic’s picture

FYI, the commit in #3 is in Provision, since it affected aegir.make.

kerolar’s picture

Fixed in 6f0275f

Please can someone explain how to make this error go away for a newbie. I have just installed Aegir with PHP 5.4.26 and it's driving me crackers.

helmo’s picture

@kerolar: #3 was a core patch to reduce the noice. You can also masq some of the pain on the admin/settings/error-reporting page

kerolar’s picture

Thanks helmo. After I installed 6.x-2.0 the Drupal version was 6.29, I then updated to 6.30 in the hostmaster directory with drush. Later I reinstalled (for other reasons), didn't update and the error hasn't appeared, so I issued this:

$ grep '[hostmaster]' /var/aegir/.drush/provision/aegir.make  
core = 6.x
api = 2
; this makefile fetches the latest release from Drupal.org
; it is maintained through the release.sh script
projects[hostmaster][type] = "core"
projects[hostmaster][patch][] = "http://drupal.org/files/common.inc_6.28.patch"
projects[hostmaster][version] = "6.x-2.0"

and noticed 6.28.patch? I'm still working my way through the documentation, should I have updated the frontend to 6.30 another way?

Cheers

nitishchopra’s picture

Status: Postponed » Needs review
FileSize
18.97 KB

Hi to solve these warnings I created a patch.

helmo’s picture

Status: Needs review » Postponed

@nitishchopra: sorry but your patch had multiple unrelated changes. You might wanna have a look in the views issue queue for similar patches: https://drupal.org/project/issues/views?text=E_STRICT&status=All

@kerolar: The common.inc_6.28.patch patch also applies to 6.30

Setting status back to postponed, as #1954296: Restore original D6 behaviour to prevent logging E_STRICT warnings is the one that needs to be fixed first.

ergonlogic’s picture

Status: Postponed » Closed (outdated)

The 6.x-2.x branch will go EOL along with Drupal this week. So I'm closing this issue. If it remains a confirmed issue in 7.x-3.x, feel free to re-open, or better yet, create a new issue referencing this one.