Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.16
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
6 Nov 2012 at 09:22 UTC
Updated:
30 Nov 2014 at 01:40 UTC
Jump to comment: Most recent
Hello.
i tried to transfer my site from my localhost to another computer with newest xampp version and i receive the following error:
strict warning: Non-static method view::load() should not be called statically in C:\xampp\htdocs\drupal\sites\all\modules\views\views.module on line 906.
i 've read http://drupal.org/node/465332 but i cannot understand what i should change to the code or where...
Any help will be appreciated
Thanks in advance
Comments
Comment #1
rob230 commentedAs far as I understand it, this won't be fixed for Drupal 6.x versions because fixing it will break PHP 4 compatibility. Apart from the strict warning it is harmless so I believe the advice is to disable strict warnings on the production site.
If you want to fix it, I assume you just put the 'static' keyword on whatever function is being called statically. PHP 4 doesn't support 'static' therefore adding it would break PHP 4, whereas in PHP 5 if you don't declare it 'static' then it works it just generates a warning if you have E_STRICT. Hence why the decision to not declare it static in 6.x.
Comment #2
stephr commented@Rob230: Is the same true for other issues popping up while using a combination of views 3.0, D6 and PHP 5.4?
For instance:
strict warning: Declaration of views_handler_field::query() should be compatible with views_handler::query($group_by = false) in /etc/drupal6/mysite/modules/contrib/views/handlers/views_handler_field.inc on line 1147.
strict warning: Declaration of views_handler_sort::options_validate() should be compatible with views_handler::options_validate($form, &$form_state)
strict warning: Declaration of views_handler_sort::options_submit() should be compatible with views_handler::options_submit($form, &$form_state)
strict warning: Declaration of views_handler_sort::query() should be compatible with views_handler::query($group_by = false)
strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state)
strict warning: Declaration of views_handler_filter::query() should be compatible with views_handler::query($group_by = false)
strict warning: Declaration of views_plugin_query::options_submit() should be compatible with views_plugin::options_submit($form, &$form_state) in /etc/drupal6/mysite/modules/contrib/views/plugins/views_plugin_query.inc on line 169.
strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options()
strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state)
strict warning: Declaration of content_handler_field::element_type() should be compatible with views_handler_field::element_type($none_supported = false, $default_empty = false, $inline = false) in /etc/drupal6/mysite/modules/contrib/cck/includes/views/handlers/content_handler_field.inc on line 229.
strict warning: Declaration of date_handler_field_multiple::pre_render() should be compatible with views_handler_field::pre_render($values) in /etc/drupal6/mysite/modules/contrib/date/date/date_handler_field_multiple.inc on line 185.
Comment #3
dawehnerStrict warnings can be always turned of in your php.ini/.htaccess/settings.php so it is not a problem
http://drupal.org/node/465332#comment-1600034 explains some reasons why we can't fix it.
Comment #4
crutch commented"Strict warnings can be always turned of in your php.ini/.htaccess/settings.php so it is not a problem"
I've yet to find something that works.
I know the issue is that there is no solution to the problem without module code patches that will be overwritten on updates. So the band-aid is to exclude strict errors and not have it fill the logs. Every page view produces many errors so getting big performance hit and huge log file.
Turning off in just php.ini doesn't work as E_ALL includes E_STRICT even though it's excluded with this statement.
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICTHow would I edit php.ini and .htaccess and settings.php to make this go away?
Comment #5
dawehnerSee http://drupal.org/node/158043 how to disable it withing settings.php
Comment #7
francewhoaAnother option at https://www.drupal.org/node/465332#comment-9388733