Problem/Motivation

Following notice is thrown in PublishContentNode::render():

Notice: Only variables should be passed by reference in Drupal\Publishcontent\Plugin\Views\field\PublishContentNode->render() (line 56 of publishcontent/src/Plugin/views/field/PublishContentNode.php).

Proposed resolution

Store the render array first in a variable before passing it to the other render function.

Remaining tasks

Reviews needed.

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

das-peter created an issue. See original summary.

grahl’s picture

Patch works fine, consider changing the variable name to a single word or camel-case.

Sut3kh’s picture

Status: Needs review » Reviewed & tested by the community

Patch works.

Maintainer does seem to prefer camel case vars but as there are none in the file I believe it is fine as per Drupal CS and not worth dragging out this 1 liner patch any longer IMO.

jeremyr’s picture

Also confirming that the patch worked.

arunkumark’s picture

Tested the patch manually working like charm. There is no any notice error.

+1

  • johnennew committed 1e56ee4 on 8.x-1.x
    Issue #2833884 by das-peter: Fix notice error.
    
das-peter’s picture

Status: Reviewed & tested by the community » Fixed

I guess that's fixed then :)
@johnennewThanks!

Status: Fixed » Closed (fixed)

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