Meteor-Community-Packages / meteor-autoform

AutoForm is a Meteor package that adds UI components and helpers to easily create basic forms with automatic insert and update events, and automatic reactive validation.
MIT License
1.44k stars 328 forks source link

update-pushArray + schema.extend() is broken. #1690

Closed jowilhnson closed 3 years ago

jowilhnson commented 5 years ago

have quickForm / autoForm instances of update-pushArray that have worked fine until recent updates to current package versions. Now, with a base schema that is extended on the 'tests.$.scores' object, I get

The type for "scores" is set to a SimpleSchema instance that defines "scores.CFC", but the parent SimpleSchema instance also tries to define "scores.CFC"

The parent schema doesn't define scores at all, much less the individual score instances.

export const AlaStudentsSchema = StudentsBaseSchema.extend({
    'tests.$.scores': {
        type: AlaScoresSchema
    }
});

is just one form of syntax I've used to extend the schemas, various methods worked, but all of them threw the same errors in an update-pushArray scoped to "tests".

For the sake of testing, I put together a new schema that is a combo of StudentsBaseSchema with the contents of AlaScoresSchema copy/pasted into it. No errors with that, so I guess that's my workaround. Have a ton of repetition in my schemas so as to have full, non-extended schemas for any that need to be used in a update-pushArray form.

jankapunkt commented 3 years ago

This is rather a SimpleSchema issue. I will close due to silence. This may also have been resolved with AutoForm 7.0.0, please migrate to the latest version and reopen in case the issue persist