Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1301

EXTRA_LAZY collection count throws exception on OneToMany association

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      Calling count() on an EXTRA_LAZY collection throws an exception.

      Notice: Undefined index: iUserId in /../vendor/doctrine/lib/Doctrine/ORM/Persisters/OneToManyPersister.php line 142

      I've found that this is caused by looking up the fieldName for iUserId on the targetEntity, while it should be looked up at the sourceEntity. The current tests pass because all entities have a mapping of `id' -> $id.

      Tests + fix coming up.

        Activity

        Hide
        Alexander added a comment -
        Show
        Alexander added a comment - PR with tests and fix: https://github.com/doctrine/doctrine2/pull/97

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Alexander
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: