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

**URL:** <https://forums.concretecms.org/t/php-8-1-concretecms-9-1-3-trying-to-access-array-offset-on-value-of-type-null-error/4375>\
**Category:** Developing with Concrete\
**Created:** [November 4, 2022, 12:27pm UTC](https://forums.concretecms.org/t/php-8-1-concretecms-9-1-3-trying-to-access-array-offset-on-value-of-type-null-error/4375 "2022-11-04T12:27:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdius](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mdius/32/5660_2.png) [@mdius](https://forums.concretecms.org/u/mdius)\
**Post date:** [November 4, 2022, 12:27pm UTC](https://forums.concretecms.org/t/php-8-1-concretecms-9-1-3-trying-to-access-array-offset-on-value-of-type-null-error/4375/1 "2022-11-04T12:27:13Z")

</div>

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”

```auto
        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'])) {`

---

<div class="post-metadata">

**Author:** ![jessicadunbar](https://forums.concretecms.org/user_avatar/forums.concretecms.org/jessicadunbar/32/4320_2.png) [@jessicadunbar](https://forums.concretecms.org/u/jessicadunbar)\
**Post date:** [November 7, 2022, 1:03pm UTC](https://forums.concretecms.org/t/php-8-1-concretecms-9-1-3-trying-to-access-array-offset-on-value-of-type-null-error/4375/2 "2022-11-07T13:03:55Z")

</div>

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

> [@Trying to access array offset on value of type null error](https://forums.concretecms.org/t/trying-to-access-array-offset-on-value-of-type-null-error/4318/2):
>
> It looks like this is a bug. If you use an attribute Option List and use the Select Option Allow multiple options… and you do not choose an option on your community store product page for that attribute, it throws the above error.

Thank you!  
Jess

---

<div class="post-metadata">

**Author:** ![mdius](https://forums.concretecms.org/user_avatar/forums.concretecms.org/mdius/32/5660_2.png) [@mdius](https://forums.concretecms.org/u/mdius)\
**Post date:** [November 8, 2022, 2:02pm UTC](https://forums.concretecms.org/t/php-8-1-concretecms-9-1-3-trying-to-access-array-offset-on-value-of-type-null-error/4375/3 "2022-11-08T14:02:31Z")

</div>

It was requested last week, thank you though.
