Problem/Motivation

Drupal 8.9 on PHP 7.4 causes PHP Notices regarding arrays on the add RRSSB Button form. Minor fix

Notice: Trying to access array offset on value of type null in modules/contrib/rrssb/src/Form/RRSSBSettingsForm.php on line XXX
screenshot

Steps to reproduce

Visit /admin/config/content/rrssb/add with PHP 7.4 and notices turned on

Proposed resolution

Provide a default value if $appearance array does not infact have keys

Remaining tasks

User interface changes

API changes

Data model changes

Comments

NicholasS created an issue. See original summary.

nicholass’s picture

StatusFileSize
new3.28 KB

This patch works for me to remove the notices

adamps’s picture

Category: Bug report » Support request

How do you get $config->get('appearance') to be NULL? A value is specified in rrssb.button_set.default.yml. I guess you have most likely done something strange with importing/exporting config.

maxmendez’s picture

This happenes me too on PHP 8.1and Drupal 9.4.5 when save a new button set.

adamps’s picture

Category: Support request » Bug report
Status: Active » Needs review

Apologies you are quite right. Let's get the tests to run.

adamps’s picture

StatusFileSize
new4.66 KB

Let's fix the coding standards messages

  • AdamPS committed 10d15bc4 on 8.x-2.x authored by NicholasS
    Issue #3230022 by NicholasS, AdamPS, MaxMendez: PHP 7.4 Notice on Add...
adamps’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

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