Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2176

Illegal offset type in isset or empty in UnitOfWork

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.3, 2.4
    • Fix Version/s: None
    • Component/s: ORM
    • Labels:

      Description

      Steps to reproduce the problem?

      • A custom DBAL type, that extends a scalar build-in type e.g. DBAL\Types\StringType
      • convertToPHPValue of custom DBAL type returns an instance of a class (implements __toString method)
      • Custom DBAL type is used as primary key in an entity
      • initially persist entity and flush entity manager
      • modify entity (keep same primary key) and persist entity again causes:

        Warning: Illegal offset type in isset or empty in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 2407

      I guess the solution in Doctrine\ORM\Internal\Hydration namespace by explicit converting result of convertToPHPValue if result is not a scalar value.

        Issue Links

          Activity

          Yves Berkholz created issue -
          Benjamin Eberlei made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Boy Baukema made changes -
          Affects Version/s 2.4 [ 10321 ]
          Marco Pivetta made changes -
          Link This issue duplicates DDC-1998 [ DDC-1998 ]

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Yves Berkholz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: