Skip to content

Commit

Permalink
Merge pull request #1223 from dimagi/more-form-entry-instanceof-issues
Browse files Browse the repository at this point in the history
Round II : Fix for places where FormEntry objects should have been marked as Entry objects
  • Loading branch information
ctsims committed Apr 22, 2016
2 parents 44a3870 + 0ec21cf commit e47ab0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app/src/org/commcare/activities/MenuList.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.commcare.dalvik.R;
import org.commcare.fragments.BreadcrumbBarFragment;
import org.commcare.session.SessionFrame;
import org.commcare.suite.model.Entry;
import org.commcare.suite.model.FormEntry;
import org.commcare.suite.model.Menu;
import org.commcare.util.CommCarePlatform;
Expand Down Expand Up @@ -85,8 +86,8 @@ public void onItemClick(AdapterView listView, View view, int position, long id)
if (value == null) {
return;
}
if (value instanceof FormEntry) {
commandId = ((FormEntry)value).getCommandId();
if (value instanceof Entry) {
commandId = ((Entry)value).getCommandId();
} else {
commandId = ((Menu)value).getId();
}
Expand Down
5 changes: 2 additions & 3 deletions app/src/org/commcare/adapters/MenuAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.commcare.models.AndroidSessionWrapper;
import org.commcare.preferences.DeveloperPreferences;
import org.commcare.suite.model.Entry;
import org.commcare.suite.model.FormEntry;
import org.commcare.suite.model.Menu;
import org.commcare.suite.model.MenuDisplayable;
import org.commcare.suite.model.SessionDatum;
Expand Down Expand Up @@ -279,8 +278,8 @@ protected NavIconState getIconState(MenuDisplayable menuDisplayable){
NavIconState iconChoice = NavIconState.NEXT;

//figure out some icons
if (menuDisplayable instanceof FormEntry) {
SessionDatum datum = asw.getSession().getNeededDatum((FormEntry) menuDisplayable);
if (menuDisplayable instanceof Entry) {
SessionDatum datum = asw.getSession().getNeededDatum((Entry) menuDisplayable);
if (datum == null || datum.getNodeset() == null) {
iconChoice = NavIconState.JUMP;
}
Expand Down

0 comments on commit e47ab0c

Please sign in to comment.