Posted by Dave Reid on August 25, 2010 at 2:49pm
12 followers
| Project: | Views |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
Rolling a patch shortly to fix a bunch of E_STRICT notices using the latest CVS branch.
Comments
#1
Mostly fixes inconsistencies in function definitions between parent classes and child classes that need to be exactly the same.
#2
Um, oops. Forgot to sign out of my test 'normal' account...
#3
Some of them broke some stuff
#4
With the patch I'm still seeing:
Strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with that of views_handler_filter::value_validate()
Strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with that of views_handler_filter::operator_form()
Strict warning: Declaration of views_handler_field_node_new_comments::pre_render() should be compatible with that of views_handler_field::pre_render()
Strict warning: Declaration of views_plugin_argument_validate_node::options_submit() should be compatible with that of views_plugin_argument_validate::options_submit()
#5
This one tackles 1) and 2)
The other ones are very special.
#6
Thanks for the work!
#7
These should likely be backported to 6.x-3.x wherever possible as well.
#8
So dereine, is the pre_render inconsistency still an issue then? Should we file a separate issue for that one?
#9
Let's open a new issue: here is one #894274: E_STRICT pre_render
#10
Following the line of connected issues, I get the impression that this has been fixed. Closing.
#11
Automatically closed -- issue fixed for 2 weeks with no activity.
#12
No this wasn't ported yet.
#13
Subscribe from #1223996: Strict warning: Declaration of * should be compatible with that of views_handler::*
#14
We should standardize the usage of the ampersand. Here is a patch for 6.x-2.x. Will work on one for 6.x.-3.x. I got smart and searched the code base for the inconsistencies in function definitions, rather than waiting for another error to popup.
#15
Still missed one due to
function init(&$view, &$options) {VSfunction init(&$view, &$data) {#16
One thing that had to change was
3.x
- function options_validate($form, &$form_state) { }+ function options_validate(&$form, &$form_state) { }
2.x
- function options_validate(&$form, &$form_state) {+ function options_validate($form, &$form_state) {
Reason has to do with views/handlers/views_handler_sort.inc
<?php
/**
* A special handler to take the place of missing or broken handlers.
*/
class views_handler_sort_broken extends views_handler_sort {
function ui_name($short = FALSE) {
return t('Broken/missing handler');
}
function ensure_my_table() { /* No table to ensure! */ }
function query() { /* No query to run */ }
function options_form(&$form, &$form_state) {
$form['markup'] = array(
'#prefix' => '<div class="form-item description">',
'#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
);
}
/**
* Determine if the handler is considered 'broken'
*/
function broken() { return TRUE; }
}
?>
#17
Found another one
Strict warning: Declaration of views_handler_filter_user_name::value_submit() should be compatible with that of views_handler_filter_in_operator::value_submit() in views_include_handler()
#18
Take a look to this "patch"
#19
I tried the patch in #17 for 6.x-3.x, but I'm still getting lots of PHP Strict warnings when running tests.
#20
There are definitive a ton of problems which were caused by d7 only patches/changes in other d7 only patches.
#21
@sun
Can you provide more info on what bits of code is throwing the strict warnings in your case?
#22
Updated patch for d6-2.x. Includes some additional E_STRICT declaration notices. Still need to go through and check to see if these are required in 3.x.
#23
@sun
Some of the strict warnings may be related to this ticket: http://drupal.org/node/465332
Which was set as "won't fix" by merlinofchaos due to php4 compatibility issues.
#24
So it looks like none of these patches are in 6.x-3.x yet.
I'm still getting tons of strict notices. Of course, you can turn these off, but this is my development box, and these kinds of notices are very *germane* (ie, inconsistent declarations are clear pathways for bugs to appear.
Can we say 6.x-3.x should drop PHP 4 support and commit these?
#25
Hi there,
How to use the patch file for avoiding strict warning issues as i am getting such warning while using flag friend with views.
Thanks,
#26
Let's ignore this scope changing.
@developer_426: For specific issues please create a new issue, with the error :)
#27
Another updated patch for d6-2.x.
Has anyone gotten a chance to look at 3.x for this?
#28
Cleaned out some whitespace changes, and added fix for pre_render compatibility for 2.x patch.
#29
Thanks hyrcan for this patch.
#30
@hyrcan, thanks for the 6x-2x patch. I changed the status of the issue back to "needs review" so your patch can be tested. If it passes the tests, I'll try to roll one for 6.x-3.x based on it.
#31
The last submitted patch, views-893128-28-d6-2x.patch, failed testing.