Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | 974542-notice-pre_render.patch | 5.46 KB | dawehner |
Screenshot from the view settings | 117.42 KB | phobia |
Comments
Comment #1
dawehnerMarked #894274: E_STRICT pre_render as duplicate.
This issue has more informations.
Comment #2
dawehnerDoes this patch fixes the problem for you?
Comment #3
phobia CreditAttribution: phobia commentedThanks 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 indrupal_render
.Changing line 198 in modules/field/views_handler_field_field.inc to the following would solve it:
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. :)
Comment #4
dawehnerFeel free to create a new issue. Attach a patch and it will be commited.
Comment #5
bendiy CreditAttribution: bendiy commented@dereine
#2 fixed some issues I was having with Drupal Commerce.
#976106: Views errors before content is added
Comment #6
zOner CreditAttribution: zOner commented@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
to
Comment #7
dawehner@z0ner
That's wrong.
Pre_render should have &$values.
Comment #8
pfrenssenthe patch in #2 fixes the problem for me
Comment #9
bendiy CreditAttribution: bendiy commentedComment #10
dawehnerThis patch was already commited.