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

afFieldValueIs Helper: Cannot read property 'schema' of undefined #753

Closed
ghost opened this issue Mar 10, 2015 · 10 comments
Closed

afFieldValueIs Helper: Cannot read property 'schema' of undefined #753

ghost opened this issue Mar 10, 2015 · 10 comments

Comments

@ghost
Copy link

ghost commented Mar 10, 2015

I'm quite new to Meteor and I just stumbled upon this error when using the afFieldValueIs Helper:
Exception in template helper: TypeError: Cannot read property 'schema' of undefined

(I copied the tutorial from http://autoform.meteor.com/fieldvalues and it worked like a charm before the update of autoform)

kind regards

ps: sorry for my bad English :)

@aldeed
Copy link
Collaborator

aldeed commented Mar 10, 2015

Hi please link to a reproduction repo or MeteorPad. The tutorial you link to is currently using af5 and does not have that error.

@thehopwood
Copy link

I have seen this error when using afFieldIsInvalid ... not sure if legitimate bug or developer error though.

@Rongky
Copy link

Rongky commented Mar 19, 2015

Also having this error after updating to af5. All caused by afFieldLabelText, afFieldIsInvalid and afFieldMessage. So I reverted back to af4.2.2 and there's no more error.

@aldeed
Copy link
Collaborator

aldeed commented Mar 19, 2015

Can someone post full reproduction code?

@solo999
Copy link

solo999 commented Mar 19, 2015

I can not reproduce it due to complicated code. But what I found (I have same error after upgrade to af5), that AutoForm.getFormSchema() return 'undefined' in parseOptions function. Hope it helps...
function parseOptions(options) {
var hash = (options || {}).hash || {};
// Find the form's schema
var ss = AutoForm.getFormSchema();
// Call getDefs for side effect of throwing errors when name is not in schema
if (hash.name) {
AutoForm.Utility.getDefs(ss, hash.name);
}
return _.extend({}, hash, {ss: ss});
}

and my AutoForm in html has the following attrs:
{{#autoForm collection="Notify" id="destinationForm" type=destinationFormType meteormethod="addDestination"}}

@solo999
Copy link

solo999 commented Mar 19, 2015

I have tried to reproduce it in MeteorPad, but it works normally. The difference is MeteorPad has 1.0.2.1 version of Meteor. And I have above problem on 1.0.4.1
When I downgrade my meteor to 1.0.2.1 autoform afFieldValueIs works as a charm.
So the problem is in combination of Meteor 1.0.4.1 and af5

@shkomg
Copy link

shkomg commented Mar 19, 2015

I have this poblem on Meteor 1.0.4.1 & af5.0.2

I happens with afFieldValueIs and when you have type="method"

here is the link to the repo with this error reproduced: https://github.com/shkomg/autoform-demo

@shkomg
Copy link

shkomg commented Mar 20, 2015

@aldeed I've posted full reproduction code in the post above.

Thank you.

@aldeed
Copy link
Collaborator

aldeed commented Mar 20, 2015

Seems like duplicate of #790. AF isn't compatible 1.0.4.1 pending some kind of fix or solution from MDG.

@aldeed
Copy link
Collaborator

aldeed commented Mar 20, 2015

New AF release is compatible with 1.0.4+ and should get rid of this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants