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

Problem when using with artwells/meteor-accounts-guest #142

Open
alansikora opened this issue Oct 12, 2015 · 1 comment
Open

Problem when using with artwells/meteor-accounts-guest #142

alansikora opened this issue Oct 12, 2015 · 1 comment

Comments

@alansikora
Copy link

There is a problem at PublishContext, line 44:

PublishContext.prototype.changed = function(collection, id, fields) {
  var collectionData = this._collectionData;

  collectionData[collection] = collectionData[collection].map(function(doc) {
    if (doc._id === id) {
      return _.extend(doc, fields);
    }

    return doc;
  });
};

It tries to map to an undefined array when using artwells/meteor-accounts-guest package.

I'm on a really tight deadline so I could not really study the reasons, but I believe we need to keep that map safe by making a simple change.

brettle added a commit to brettle/fast-render that referenced this issue Dec 8, 2015
Change PublishContext.changed() and PublishContext.removed() to ensure that the
collection exists, and if there isn't a doc with the requested id in the current
publish context, to look for one that was published in another publish context.
If one is found, changed() adds the doc to the current publish context and
removed() does nothing. If there isn't, both throw the same errors that would be
thrown by the merge box.
@brettle
Copy link

brettle commented Dec 8, 2015

PR #154 fixes this.

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