Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-89

CLONE -UnitOfWork incorrectly updates all documents with embedded documents on flush

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0BETA2
    • Component/s: Persister
    • Labels:
      None
    • Environment:
      OS X 10.6.4, PHP 5.3.2, Mongo 1.6.3 (can reproduce on Ubuntu 8.04.4 LTS, CentOS, Win 7, etc)

      Description

      I use the MODM-83 fix, now i cant delete childrens with a other embedded document:

      The complete document
      {
         "_id" : ObjectId("4caeea835634c915360a0000"),
         "categories" : {
           "0" : {
             "id" : ObjectId("4cbd55f55634c99177030000"),
             "name" : "neue Kategorie",
             "questions" : {
               "0" : {
                 "id" : ObjectId("4cbd55f75634c99177040000"),
                 "name" : "neue Frage",
                 "relevance" : 0,
                 "multi" : 0,
                 "answertype" : 0,
                 "other" : 0
              }
            }
          }
        },
         "description" : "pipapo!",
         "name" : "ich bin ein Katalog",
         "version" : 1
      }
      

      Now i add a new answer too the question:

      The question with the new answer
      "questions" : {
               "0" : {
                 "answers" : {
                   "0" : {
                     "id" : ObjectId("4cbd56b95634c99b5b090000"),
                     "name" : "neue Antwort"
                  }
                },
                 "answertype" : 0,
                 "id" : ObjectId("4cbd55f75634c99177040000"),
                 "multi" : 0,
                 "name" : "neue Frage",
                 "other" : 0,
                 "relevance" : 0
              } 
      }
      

      When i delete now the new answer i have a empty array and i cant delete the question from the categorie.

      The unkillable question
      "questions" : {
               "0" : {
                 "answers" : [
                  
                ],
                 "answertype" : 0,
                 "id" : ObjectId("4cbd55f75634c99177040000"),
                 "multi" : 0,
                 "name" : "neue Frage",
                 "other" : 0,
                 "relevance" : 0
              }
            }
      

      Its a unkillable entry now.
      Sorry for my bad english.

        Activity

        Hide
        Jonathan H. Wage added a comment -

        I don't understand the issue. Can you show some php code that shows what you are trying to persist?

        Show
        Jonathan H. Wage added a comment - I don't understand the issue. Can you show some php code that shows what you are trying to persist?
        Hide
        Jonathan H. Wage added a comment -

        I'm pretty certain this is no longer an issue.

        Show
        Jonathan H. Wage added a comment - I'm pretty certain this is no longer an issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Alexander Koß
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: