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

Refactors FormHierarchyActivity #1038

Merged
merged 8 commits into from
Jan 9, 2018

Conversation

shobhitagarwal1612
Copy link
Contributor

Fixes #740

@shobhitagarwal1612
Copy link
Contributor Author

@lognaturel Please review

@getodk-bot
Copy link
Member

Heads up @shobhitagarwal1612, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

@lognaturel
Copy link
Member

@shobhitagarwal1612 I must admit I'm not quite sure why this has been sitting for so long! I think between there being no description and the other form hierarchy pull request it got lost in the shuffle.

Please fix the small merge conflicts and we can get this through a round of testing.

@shobhitagarwal1612
Copy link
Contributor Author

@lognaturel Done

@mmarciniak90
Copy link
Contributor

@shobhitagarwal1612 Could you tell me what behaviors may have changed?
What should be tested more carefully?

@shobhitagarwal1612
Copy link
Contributor Author

shobhitagarwal1612 commented Dec 23, 2017

Fill Blank Form, Edit Saved Form, S̶e̶n̶d̶ ̶F̶i̶n̶a̶l̶i̶z̶e̶d̶ ̶F̶o̶r̶m̶ - Should allow editing the forms
View Sent Form - Should not allow editing the forms

@mmarciniak90
Copy link
Contributor

mmarciniak90 commented Jan 8, 2018

Send Finalized Form does not give an opportunity to edit a form.
@shobhitagarwal1612, I suppose it is mistake in you comment, please confirm that.

@shobhitagarwal1612
Copy link
Contributor Author

@mmarciniak90 Yes, it was a mistake in my comment. Thank you for pointing it out 👍
I've edited the comment

@mmarciniak90
Copy link
Contributor

Tested with success!
Verified on Android: 4.1, 4.2, 4.4, 5.1, 6.0, 7.0, 8.0
Regression was not noticed.
Merging this issue allows us to test this changes also during testing other issues.

@mmarciniak90
Copy link
Contributor

@opendatakit-bot unlabel "needs testing"

# Conflicts:
#	collect_app/src/main/java/org/odk/collect/android/activities/FormHierarchyActivity.java
@lognaturel lognaturel merged commit 10a2578 into getodk:master Jan 9, 2018
@lognaturel
Copy link
Member

@shobhitagarwal1612 the best things are worth the wait, right? 🙃

@shobhitagarwal1612 shobhitagarwal1612 deleted the issue-740 branch January 10, 2018 04:56
@shobhitagarwal1612
Copy link
Contributor Author

@lognaturel Well said 😄

shobhitagarwal1612 added a commit to shobhitagarwal1612/collect that referenced this pull request May 15, 2018
lognaturel added a commit that referenced this pull request Jul 9, 2018
The changes in #998 introduced a null check to make sure the FormHierarchyActivity is closed when FormController is null.

#1038 created a subclass of FormHierarchyActivity -> ViewFormHierarchyActivity. This caused a reintroduction of the bug fixed in #998, as the subclass does not recheck for null in the onCreate() method.

When the same situation that caused crash fixed in #998 occurs in the ViewFormHierarchyActivity following steps will happen:

- ViewFormHierarchyActivity will start with calling super.onCreate()
- A null check in super.onCreate() parent class FormHierarchyActivity::onCreate will call shortcut the onCreate() method by calling return, and call finish() on activity.
- finish() will be scheduled to close the activity asynchronously after the onCreate() is finished
- super.onCreate() is done, the rest of the onCreate() method in ViewFormHierarchyActivity will be called. The shortcut only affected stopping super.onCraete(), the onCreate() is still called.
- Collect.getInstance().getFormController() will still be null. It needs to be to be shortcut again. No need to call finish() this time, as it was already called in the super.onCreate().
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.

4 participants