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

Open
opened 2026-01-22 15:38:34 +01:00 by admin · 0 comments
Owner

Originally created by @CsabaNa on GitHub (Jul 6, 2021).

Bug Report

I assume there is a typo in the BasicEntityPersister.php at line 1685
I have not tested with the lates 2.9.3 yet but

Q A
BC Break yes
Version 2.9.1

Summary

In the BasicEntityPersister.php at line 1685 the ternary checks the $assoc not the $association

                $joinColumns   = $assoc['isOwningSide']
                    ? $association['joinTable']['joinColumns']
                    : $association['joinTable']['inverseJoinColumns'];

Current behavior

it failing due to wrong variable name:

Warning: Trying to access array offset on value of type null (at .../vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php line 1685).

How to reproduce

E.g. call findOneBy with ManyToMany relation condition.

Expected behavior

Do not throw exceptions and find the record(s)

Originally created by @CsabaNa on GitHub (Jul 6, 2021). ### Bug Report I assume there is a typo in the `BasicEntityPersister.php` at line 1685 I have not tested with the lates 2.9.3 yet but | Q | A |------------ | ------ | BC Break | yes | Version | 2.9.1 #### Summary In the `BasicEntityPersister.php` at line 1685 the ternary checks the `$assoc` not the `$association` ``` $joinColumns = $assoc['isOwningSide'] ? $association['joinTable']['joinColumns'] : $association['joinTable']['inverseJoinColumns']; ``` #### Current behavior it failing due to wrong variable name: ``` Warning: Trying to access array offset on value of type null (at .../vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php line 1685). ``` #### How to reproduce E.g. call `findOneBy` with `ManyToMany` relation condition. #### Expected behavior Do not throw exceptions and find the record(s)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6784