I've created a page display using fields, and node type as filter.

As fields I've selected all 6 of the fields for the content type as well as the node title.

Upon saving, the module says:

Strict warning: Declaration of views_handler_field_field::pre_render() should be compatible with that of views_handler_field::pre_render() in require_once() (line 34 of /Users/me/Sites/drupal/sites/all/modules/views/modules/field/views_handler_field_field.inc).

When viewing frontend, it says:

# Strict warning: Declaration of views_handler_field_field::pre_render() should be compatible with that of views_handler_field::pre_render() in require_once() (line 34 of /Users/me/Sites/drupal/sites/all/modules/views/modules/field/views_handler_field_field.inc).

# Strict warning: Only variables should be passed by reference in views_handler_field_field->render() (line 198 of /Users/me/Sites/drupal/sites/all/modules/views/modules/field/views_handler_field_field.inc).

That last message repeats equal to the number of fields

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Marked #894274: E_STRICT pre_render as duplicate.
This issue has more informations.

dawehner’s picture

Status: Active » Needs review
FileSize
5.46 KB

Does this patch fixes the problem for you?

phobia’s picture

Thanks for the patch, dereine. :)

It didn't fix my spesific problem which seems to be using the return of the field_view_field function directly in drupal_render.

Changing line 198 in modules/field/views_handler_field_field.inc to the following would solve it:

      $data = field_view_field($entity_type, $object, $this->definition['field_name'], $display);
      return drupal_render($data);

I could of course contribute this myself I guess, but I haven't read up on how to (all new to drupal ;), but I guess it's time. :)

dawehner’s picture

Feel free to create a new issue. Attach a patch and it will be commited.

bendiy’s picture

@dereine
#2 fixed some issues I was having with Drupal Commerce.
#976106: Views errors before content is added

zOner’s picture

@dereine
the other fix is to remove the pass by reference in modules/field/views_handler_field_field.inc (rather than adding it everywhere else) as the function doesn't actually need to change the array, only sub-objects with it, i.e. change

  function pre_render(&$values) {

to

  function pre_render($values) {
dawehner’s picture

@z0ner
That's wrong.

Pre_render should have &$values.

pfrenssen’s picture

the patch in #2 fixes the problem for me

bendiy’s picture

Status: Needs review » Reviewed & tested by the community
dawehner’s picture

Status: Reviewed & tested by the community » Fixed

This patch was already commited.

Status: Fixed » Closed (fixed)

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