Skip to content

Problems with handling of related fields in EditController _edit(). #36

@davidkellerman

Description

@davidkellerman

In EditController, the _edit() method calls defaultContext() with the related parameter set to true, which eventually causes _modelAttributes() to try to load related fields.

For cc-assess Project instances, this unfortunately produces a Waterline find() operation that tries to load all the GeoRegion instances, which is a bad thing – they won't fit in memory.

There seem to be problems on multiple levels.

It's not clear that the related entities loaded by _modelAttributes() are ever made accessible. (In my reading of the code, they're assigned to the related variable, but aren't passed back to the caller.

The loading of related entities in ``_modelAttributes()` isn't restricted to the displayed attributes. It tries to load all fields with a relation, whether they're in the display list or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions