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

Saving a array over the top of a PersistentCollection results in duplicated data

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0BETA2
    • Component/s: None
    • Labels:
      None
    • Environment:
      Mongo 1.6.1, opensky/mongo-odm/master

      Description

      If you take an document that has a referenceMany and overwrite a PersistentCollection of data with an array, even of the same data, the data is appended to the collection instead of replacing it.

        Activity

        Hide
        Jonathan H. Wage added a comment -

        This is not a problem anymore after the recent refactoring!

        Show
        Jonathan H. Wage added a comment - This is not a problem anymore after the recent refactoring!
        Hide
        Jonathan H. Wage added a comment -

        Bulat, this is the same issue where PersistentCollection is never initialized so thats why the array_diff always appends the data with a $pushAll. Remember we talked about it? we can fix it just need to chat about it for a bit.

        Show
        Jonathan H. Wage added a comment - Bulat, this is the same issue where PersistentCollection is never initialized so thats why the array_diff always appends the data with a $pushAll. Remember we talked about it? we can fix it just need to chat about it for a bit.
        Hide
        Sebastian Hoitz added a comment -

        Are you using the most recent version of Doctrine MongoDB ODM?

        I'm asking because there was a bug fix for something where all embedded documents were duplicated.

        However I'm also currently investigating a bug where in some cases only one entry does not get removed (although $pullAll is called correctly).

        Show
        Sebastian Hoitz added a comment - Are you using the most recent version of Doctrine MongoDB ODM? I'm asking because there was a bug fix for something where all embedded documents were duplicated. However I'm also currently investigating a bug where in some cases only one entry does not get removed (although $pullAll is called correctly).

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Andy Stanberry
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: