Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-820

Nullable associations combined with a column definition generates a notice

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0-RC1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Ubuntu 9.10, PHP 5.3.3, MySQL 5.0.83

      Description

      When an entity has an optional association on a given field and also a column definition on that field, loading that entity generates a notice in UnitOfWork.php on line 1884. Other than the notice, the code works fine. This is the line:

      $joinColumnValue = $data[$srcColumn];

      Suggested fix:

      $joinColumnValue = isset($data[$srcColumn]) ? $data[$srcColumn] : null;

      I have attached a test case which reproduces the issue.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        This is already fixed in master, will be in RC1.

        Show
        Benjamin Eberlei added a comment - This is already fixed in master, will be in RC1.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Harold Asbridge
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: