Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KO Playlist: error luego de grabar un playlist #2

Open
pardo-bsso opened this issue Mar 19, 2013 · 6 comments
Open

KO Playlist: error luego de grabar un playlist #2

pardo-bsso opened this issue Mar 19, 2013 · 6 comments

Comments

@pardo-bsso
Copy link
Member

Elijo un playlist, modifico (o no) el contenido.
Save.
Elijo otras del resto una o varias veces, se muestran ok.

Vuelvo a elegir la original, se muestra vacia error en consola: Uncaught CollectionObservable: not a collection is unexpected vendor.js:37068

Si pico en cualquier otra la muestra ok.

@josx
Copy link
Member

josx commented Mar 22, 2013

Crear una nueva graba OK

@josx
Copy link
Member

josx commented Mar 22, 2013

El problema en KB lo hace al utilizar el
kb.utils.wrappedObject(view_model)
de abajo que no devuelve el modelo.

Y la excepción la tira cuando envía un modelo vacío a
this.create_options.store.findOrReplace(model, this.create_options.creator, view_model);

CollectionObservable.prototype._onObservableArrayChange = function(models_or_view_models) {
    var collection, has_filters, model, models, observable, view_model, view_models, _i, _len,

...

      for (_i = 0, _len = models_or_view_models.length; _i < _len; _i++) {
        view_model = models_or_view_models[_i];
        model = kb.utils.wrappedObject(view_model);
        if (has_filters) {
          if (this._modelIsFiltered(model)) {
            continue;
          }
          view_models.push(view_model);
        }
        this.create_options.store.findOrReplace(model, this.create_options.creator, view_model);
        models.push(model);
      }
    }

pardo-bsso added a commit that referenced this issue Mar 24, 2013
Es una solución temporal a #2.

Signed-off-by: Adrian Pardini <github@tangopardo.com.ar>
@pardo-bsso
Copy link
Member Author

Ahi subi algo temporal en 4158a1c

Hay que ver bien el tema de los modelos. Acá en mi base tengo listas que adentro tienen tanto un 'collection' como un 'models' con el mismo contenido (medias)

@josx
Copy link
Member

josx commented Mar 25, 2013

Si para mi este bardo tiene que ver con eso. Con como tenemos los modelos creados.

@pardo-bsso
Copy link
Member Author

Esta bien que haya elementos repetidos?
en el original había un chequeo para que no pase.

@josx
Copy link
Member

josx commented Mar 26, 2013

Para mi deberia poderse repetir medias dentro de un playlist.

pardo-bsso added a commit that referenced this issue Mar 27, 2013
Es una solución temporal a #2.

Signed-off-by: Adrian Pardini <github@tangopardo.com.ar>
pardo-bsso added a commit that referenced this issue Mar 27, 2013
Es una solución temporal a #2.

Signed-off-by: Adrian Pardini <github@tangopardo.com.ar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants