Publish loading more than once

Hi there!
I have akward problem. My collection/publish is loading three times on one page. Dou you have any idea?
I want to publish the “PLN” string, but my page load pulications more than once.

I have some subpages here, maybe that’s why it’s loading three times, but why on second and third loading my currency is “undefined” even though I have the same currencyId “zloty”?

Please post a simplified code snippet here, so that we can see what you are doing.

That’s a relly cutted snippet :wink:

In my html:

<template name="InvoicesEditEditForm">
  Total Amount:     {{cenka invoice_edits._id}} 
  {{currencyinfodetails222 invoice_edits.customerId}}

In my js:

        cena = Invoices.findOne(invoiceId);
        cenkadwa = cena.totalAmount;
        cenkatrzy = cenkadwa.toFixed(2);
        return cenkatrzy;
        var customerek = Customers.findOne(customerId);
        var walutka = customerek.currency;
        var walutaname =;
        return walutaname;

And the “cenka” is work properly, byt the “currencyinfodetails222” isn’t.

Of course I have:

Meteor.subscribe("invoice_edits", this.params.invoiceId),


customers: Customers.find({}, {}),
invoice_edits: Invoices.findOne({_id:this.params.invoiceId}, {transform:function(doc) { var sum = 0; Invoices.find({ invoiceId: doc._id }).map(function(item) { sum += item.amount; }); doc.totalAmount = sum; return doc; }}),
currency: Currency.find({}, {}),

I see that it doesn’t take the object here of my currency. But… in the first time it takes… akward.

Are you using Iron Router? Maybe this SO post might help:

Yeah, I use iron:router. I’ll see - thx

Nope, It doesn’t help. :frowning:

There is no answer… It’s bad. Iron router fires data 3 times…
But I don’t know how to stop afetr loading data once :confused:

OK, I know what to do.
I need to add every publication of my collection to subpages. Now it works :slight_smile: