Download & Extend

Fix E_STRICT notices

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

Status:active» needs review

Mostly fixes inconsistencies in function definitions between parent classes and child classes that need to be exactly the same.

AttachmentSizeStatusTest resultOperations
893128-views-stricts-D7.patch8.94 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 893128-views-stricts-D7.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#2

Um, oops. Forgot to sign out of my test 'normal' account...

#3

Some of them broke some stuff

AttachmentSizeStatusTest resultOperations
893128-views-stricts-D7.patch12.65 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 893128-views-stricts-D7_0.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#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.

AttachmentSizeStatusTest resultOperations
893128-views-stricts-D7.patch4.4 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 893128-views-stricts-D7_1.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#6

Status:needs review» fixed

Thanks for the work!

#7

Version:7.x-3.x-dev» 6.x-3.x-dev
Status:fixed» patch (to be ported)

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

Status:patch (to be ported)» fixed

Following the line of connected issues, I get the impression that this has been fixed. Closing.

#11

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#12

Status:closed (fixed)» patch (to be ported)

No this wasn't ported yet.

#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.

AttachmentSizeStatusTest resultOperations
views-893128-14-D6-2.x.patch11.68 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-893128-14-D6-2.x.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#15

Still missed one due to function init(&$view, &$options) { VS function init(&$view, &$data) {

AttachmentSizeStatusTest resultOperations
views-893128-15-D6-2.x.patch12.32 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-893128-15-D6-2.x.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#16

Status:patch (to be ported)» needs review

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; }
}
?>
AttachmentSizeStatusTest resultOperations
views-893128-16-D6-3.x.patch8.43 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-893128-16-D6-3.x.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#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()

AttachmentSizeStatusTest resultOperations
views-893128-17-D6-2.x.patch12.58 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-893128-17-D6-2.x.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test
views-893128-17-D6-3.x.patch8.94 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-893128-17-D6-3.x.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#18

Take a look to this "patch"

AttachmentSizeStatusTest resultOperations
views-893128-killua99-1-D6-2.x.patch972 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Invalid patch format in views-893128-killua99-1-D6-2.x.patch.View details | Re-test

#19

Status:needs review» needs work

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.

AttachmentSizeStatusTest resultOperations
views-893128-21-D6-2.x.patch13.86 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-893128-21-D6-2.x.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#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

Version:6.x-3.x-dev» 7.x-3.1

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

Version:7.x-3.1» 6.x-3.x-dev

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?

AttachmentSizeStatusTest resultOperations
views-893128-27-d6.2.x.patch13.68 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-893128-27-d6.2.x.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#28

Cleaned out some whitespace changes, and added fix for pre_render compatibility for 2.x patch.

AttachmentSizeStatusTest resultOperations
views-893128-28-d6-2x.patch13.6 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch views-893128-28-d6-2x.patch. Unable to apply patch. See the log in the details link for more information.View details | Re-test

#29

Thanks hyrcan for this patch.

#30

Status:needs work» needs review

@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

Status:needs review» needs work

The last submitted patch, views-893128-28-d6-2x.patch, failed testing.

nobody click here