Notices are thrown when we try to install module and run some tests on CI (for our case Travis). This can be avoided.

stdClass Object
  │  (
  │      [wid] => 361
  │      [uid] => 0
  │      [type] => php
  │      [message] => %type: @message in %function (line %line of %file) @backtrace_string.
  │      [variables] => Array
  │          (
  │              [%type] => Notice
  │              [@message] => Drupal\Core\Render\Markup Object
  │                  (
  │                      [string:protected] => Undefined variable: alias
  │                  )
  │  
  │              [%function] => cookieconsent_page_attachments()
  │              [%file] => /home/travis/build/docroot/modules/contrib/cookieconsent/cookieconsent.module
  │              [%line] => 90
CommentFileSizeAuthor
#3 2946306-3.patch1.01 KBnikunjkotecha

Comments

nikunjkotecha created an issue. See original summary.

nikunjkotecha’s picture

Title: Avoid warnings when privacy policy node not set » Avoid notice when privacy policy node not set
Issue summary: View changes
nikunjkotecha’s picture

Status: Active » Needs review
StatusFileSize
new1.01 KB
ericshell’s picture

I am also experiencing this issue. @nikunjkotecha's patch in #3 worked perfectly.

markhalliwell’s picture

Title: Avoid notice when privacy policy node not set » Notice: Undefined variable: alias in cookieconsent_page_attachments()
Status: Needs review » Reviewed & tested by the community

I too created a similar issue/patch (#2975400: Notice: Undefined variable: alias in cookieconsent_page_attachments()) and closing it as a dup of this one.

nitebreed’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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