This is a follow up from this issue https://www.drupal.org/project/shariff/issues/3129454 to apply the patch provided by @rwam to fix:

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.

Comments

mathilde_dumond created an issue. See original summary.

mathilde_dumond’s picture

StatusFileSize
new598 bytes
johnchque’s picture

Status: Active » Needs review
berdir’s picture

+++ b/shariff.module
@@ -141,7 +141,7 @@ function _shariff_get_settings($blocksettings = NULL) {
 
-  if ($blocksettings && !$blocksettings['shariff_default_settings']) {
+  if ($blocksettings && !isset($blocksettings['shariff_default_settings'])) {
     // block specific settings are active.
     $services = $blocksettings['shariff_services'];

I'm not sure if !isset() is the same thing, what are the possible values of shariff_default_settings.

Both TRUE and FALSE would evaluate to FALSE here, only NULL would be TRUE.

empty() might make more sense here, FALSE/0/NULL/'' would all result in TRUE while basically any other value would be FALSE.

mathilde_dumond’s picture

StatusFileSize
new604 bytes
new597 bytes
berdir’s picture

Status: Needs review » Reviewed & tested by the community

granik’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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