This is a small patch against 6.x-3.x to some views handler declarations, to prevent the warnings below when in an E_STRICT environment, such as PHP 5.4.

As necessity and opportunity allow, I hope to keep this this comprehensive and freshly rolled. I encourage others to post additional patches here, if they find further E_STRICT warnings, wherever they may be.

content_handler_field::element_type() should be compatible with views_handler_field::element_type($none_supported = false, $default_empty = false, $inline = false) in cck\includes\views\handlers\content_handler_field.inc on line 228.

Declaration of content_handler_field_multiple::query() should be compatible with views_handler_field::query($group_by = false) in cck\includes\views\handlers\content_handler_field_multiple.inc on line 321.

Declaration of content_handler_field_multiple::pre_render() should be compatible with views_handler_field::pre_render(&$values) in cck\includes\views\handlers\content_handler_field_multiple.inc on line 321.

Declaration of content_handler_field_multiple::element_type() should be compatible with content_handler_field::element_type($none_supported = false, $default_empty = false, $inline = false) in cck\includes\views\handlers\content_handler_field_multiple.inc on line 321.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mw4ll4c3’s picture

mw4ll4c3’s picture

Status: Active » Needs review
mw4ll4c3’s picture

Issue summary: View changes
mw4ll4c3’s picture

Issue summary: View changes
FileSize
2.41 KB
SeanA’s picture

Status: Needs review » Reviewed & tested by the community

Thank you, patch in #4 fixes these warnings. Patch applied to CCK 6.x-2.9 succeeded with offsets.

mw4ll4c3’s picture

Assigned: mw4ll4c3 » Unassigned
roball’s picture

Thank you mw4ll4c3 for the patch #4. I can confirm it fixes the error

Declaration of content_handler_field_multiple::pre_render() should be compatible with views_handler_field::pre_render(&$values) in /etc/drupal6/all/modules/cck/includes/views/handlers/content_handler_field_multiple.inc on line 321.

with CCK 6.x-3.0-alpha3+13-dev.

Michelle’s picture

I'm working off the 2.x branch and, even though the existing patch applied cleanly, I'm not so sure making a new patch off the wrong branch is a good idea so I'm just going to attach the interdiff for my addition.

This is to fix:

Strict warning: Only variables should be passed by reference in content_field_edit_form_validate() (line 1282 of /sites/all/modules/cck/includes/content.admin.inc).

DamienMcKenna’s picture

DamienMcKenna’s picture

DamienMcKenna’s picture

FYI the patch still applies to the current 6.x-2.x.

DamienMcKenna’s picture

Albert Volkman’s picture

+1 for RTBC

goldlilys’s picture

+1 for #4 patch

Michelle’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
3.21 KB

I took the patch from #4 and added in my changes in #8 and made a combined patch against the 3.x branch.

mw4ll4c3’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for the formal patch. I've been using your change for a while, and confirm Patch #15 applies cleanly against 6.x-3.x

Not worth holding anything up, but: looking at that change again, I'm curious if the sequence couldn't just be

reset($form_values['default_value_widget']);
key($form_values['default_value_widget']);
$default_value = $form_values['default_value_widget'][$key];

or even just
$default_value = reset($form_values['default_value_widget']);

roball’s picture

joachim’s picture

I can confirm that this patch also applies to 2.x, with slight fuzz.

dawehner’s picture

Works for me, thank you! Note https://www.drupal.org/node/2411093#comment-10304311 ... so the $group_by = FALSE change is not necessarily required.

Steel Rat’s picture

I installed the 6.x.3.x alpha version, and made the patches in the head post, but I still get the date handler error from this thread: https://www.drupal.org/node/1948238

I was instructed to patch CCK from here since that's where the actual error is. Didn't help.

The upgrade to PHP and MySQL 5.5 has just been a disaster.

DamienMcKenna’s picture

Steel Rat: You need to patch CCK and Views too, and look through the list of PHP 5.4 and PHP 5.5 issues for other patches to apply.

Steel Rat’s picture

Thanks Damien, but I'm thinking running a literal patchwork system is not a good idea.

I'll have to try to upgrade to D7 this weekend for one of my sites in particular that I use at work. But even then some of the modules I need are still in alpha. Frustrating.

roball’s picture

@Steel Rat: rather than patching all D6 core modules having PHP 5.4 E_STRICT issues, I would recommend to just apply the one patch #1954296: Restore original D6 behaviour to prevent logging E_STRICT warnings.

Steel Rat’s picture

@roball

Done, thanks!

roball’s picture

SeanA’s picture

Per dawehner at #19, this is not necessary:

-  function query() {
+  function query($group_by = false) {

Because the patch for Views over there does this:

+   *
+   * @param bool $group_by
+   *   (optional) Whether the view is using an aggregation query. If you
+   *    override this method you can specify $group_by as optional parameter.
    */
-  function query($group_by = FALSE) { }
+  function query() { }

This patch is identical to the last patch, without the $group_by = false part. Applies to both 6.x-2.x and 6.x-3.x.

jwilson3’s picture

Confirming that #26 is the right approach. RTBC.

budalokko’s picture

Patch in #26 worked for me on CCK 6.x-2.10 and removed message in PHP 5.6.

mw4ll4c3’s picture

osopolar’s picture