These warnings are shown when the "Use Shariff default settings" is checked on a new Shariff block.

Steps to reproduce

  1. Create a shariff block with "Use Shariff default settings" checked
  2. Visit the page where that Shariff block is useed
Notice: Undefined index: shariff_services in _shariff_get_settings() (line 147 of modules/contrib/shariff/shariff.module).
Notice: Undefined index: shariff_theme in _shariff_get_settings() (line 148 of modules/contrib/shariff/shariff.module).
Warning: Invalid argument supplied for foreach() in _shariff_get_settings() (line 182 of modules/contrib/shariff/shariff.module).

This happens only for the first time when the "Use Shariff default settings" is checked. If we uncheck this setting and save, this warning will not appear again for the same block.

Warning

Comments

sushyl created an issue. See original summary.

sushyl’s picture

StatusFileSize
new756 bytes
sushyl’s picture

Status: Active » Needs review
sushyl’s picture

Issue summary: View changes
criz’s picture

Status: Needs review » Reviewed & tested by the community

I can not reproduce this issue. But the further check should be okay.

  • criz committed c774696 on 8.x-1.x authored by sushyl
    Issue #3129454 by sushyl: Warnings and notice in _shariff_get_settings()
    
criz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

rwam’s picture

Hi @criz,

but the submitted patch leads to the following notice now:

Notice: Undefined index: shariff_default_settings in _shariff_get_settings() (line 144 of /…/modules/contrib/shariff/shariff.module

Using isset() solves this for me. See attached patch.

Ciao
Ralf