# Trying to access array offset on value of type null error

**URL:** <https://forums.concretecms.org/t/trying-to-access-array-offset-on-value-of-type-null-error/4318>\
**Category:** Developing with Concrete\
**Created:** [October 31, 2022, 3:43pm UTC](https://forums.concretecms.org/t/trying-to-access-array-offset-on-value-of-type-null-error/4318 "2022-10-31T15:43:44Z")\
**Posts on this page:** 5\
**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:** [October 31, 2022, 3:43pm UTC](https://forums.concretecms.org/t/trying-to-access-array-offset-on-value-of-type-null-error/4318/1 "2022-10-31T15:43:44Z")

</div>

Using ConcreteCMS 9.1.2  
PHP 8.1.11  
It goes away if I switch back to PHP 7.3, it happens when I Update a product in community store. I have posted it on the Community Store GitHub page as well.

Error “/updates/concrete-cms-9.1.2/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;
                    }
                }
            }

```

---

<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 3, 2022, 3:49pm UTC](https://forums.concretecms.org/t/trying-to-access-array-offset-on-value-of-type-null-error/4318/2 "2022-11-03T15:49:24Z")

</div>

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.

---

<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, 11:53am UTC](https://forums.concretecms.org/t/trying-to-access-array-offset-on-value-of-type-null-error/4318/3 "2022-11-04T11:53:05Z")

</div>

Upgraded to 9.1.3 and that did not fix it.

---

<div class="post-metadata">

**Author:** ![EvanCooper](https://forums.concretecms.org/user_avatar/forums.concretecms.org/evancooper/32/4597_2.png) [@EvanCooper](https://forums.concretecms.org/u/EvanCooper)\
**Post date:** [November 11, 2022, 5:23am UTC](https://forums.concretecms.org/t/trying-to-access-array-offset-on-value-of-type-null-error/4318/4 "2022-11-11T05:23:48Z")

</div>

Hi @mdius - is this this the Github issue?

> <https://github.com/concretecms-community-store/community_store/issues/693>
>
> I have installed Store v.2.4.6 with Concrete v.9.1.1 (PHP is 7.4.33) and I tried… to update Concrete to 9.1.2 and then comes this error message:
> 
> Entity 'Concrete\\Package\\CommunityStore\\Entity\\Attribute\\Key\\StoreOrderKey' has to be part of the discriminator map of 'Concrete\\Core\\Entity\\Attribute\\Key\\Key' to be properly mapped in the inheritance hierarchy. Alternatively you can make 'Concrete\\Package\\CommunityStore\\Entity\\Attribute\\Key\\StoreOrderKey' an abstract class to avoid this exception from occurring.
> 
> I had to return the site from backup.
> What this error means, do I have to update the Store to a newer version first or modify code somehow?
> 
> Concrete 9.1.2 version supports more webp images and that's why I need to update Concrete. Any idea how to go on?

Was this bit what ended up working for you?

> Had this error on my clean install test site and I manually turned on Database Entities - Doctrine Development Mode and then re-run script, and that worked for that site.

---

<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 11, 2022, 12:59pm UTC](https://forums.concretecms.org/t/trying-to-access-array-offset-on-value-of-type-null-error/4318/5 "2022-11-11T12:59:51Z")

</div>

No, for this issue I had to edit the core system, but Mesuva submitted it as a bug, so maybe it’ll be fixed in the next release.

But I did this:  
Edit the file /updates/concrete-cms-9.1.2/concrete/attributes/select/controller.php  
Line 260  
Was  
`if (is_array($data['atSelectOptionValue'])) {`  
Change it to  
`if (isset($data['atSelectOptionValue']) && is_array($data['atSelectOptionValue'])) {`
