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

Adds a abort button to editor form if autosave and autoform is true #1512

Merged
merged 2 commits into from
Apr 20, 2022

Conversation

johnnyblasta
Copy link
Collaborator

Closes #1508

@johnnyblasta johnnyblasta changed the title Adds a abort button if to editor form if autosave and autoform is true Adds a abort button to editor form if autosave and autoform is true Apr 5, 2022
Copy link
Contributor

@steff-o steff-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested with related tables and it works when both autoSave and autoForm is true. As the abort function is only added to the main feature it is not necessary to do anything special for related tables. It won't be possible to abort a child layer creation in this way, but I don't think that it is necessary to support that. It will only confuse the users (and developers). Aborting the main feature will also delete any newly created child features, so that is also OK.

On the other hand, when autoSave is false it crashes on abort if the feature has related layers configured. I'm not sure that it is this PR that is the culprit, it may be an earlier undiscovered bug in related tables. It think the crash occurs because when deleteFeature tries to delete a feature that has not been auto saved, it first tries to read related related objects using the temporary fid as CQL. If the FK-field in the child is an integer, the server won't be able to parse the temporary fid (which is a guid) and crashes instead of returning an empty set. The remedy would be to add a check in deleteFeature to check if the feature is saved to server before trying to delete its children.

src/controls/editor/edithandler.js Outdated Show resolved Hide resolved
@johnnyblasta johnnyblasta merged commit 914ae48 into master Apr 20, 2022
@johnnyblasta johnnyblasta deleted the editor-abort branch April 20, 2022 09:59
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

Successfully merging this pull request may close these issues.

Editor cancel adding new feature
2 participants