PHP 8.1 & ConcreteCMS 9.1.3 - Trying to access array offset on value of type null error

Using ConcreteCMS 9.1.3
PHP 8.1.12
It goes away if I switch back to PHP 7.3, it happens when I Update a product in community store.

Error “/updates/concrete-cms-9.1.3/concrete/attributes/select/controller.php”

        if ($akSelectAllowMultipleValues && !$akSelectAllowOtherValues) {
            // checkbox list.  No new options.
            $options = [];
            if (is_array($data['atSelectOptionValue'])) {             <- Error on this line (260)
                foreach ($data['atSelectOptionValue'] as $optionID) {
                    $option = $this->getOptionByID($optionID);
                    if (is_object($option)) {
                        $options[] = $option;
                    }
                }
            }

I fixed it by changing line 260 from:
if (is_array($data['atSelectOptionValue'])) {
to
if (isset($data['atSelectOptionValue']) && is_array($data['atSelectOptionValue'])) {

@mdius If it’s a bug submit an issue or a pull request with your fix to to Github. Is this a related issue?

Thank you!
Jess

It was requested last week, thank you though.

1 Like