Skip to content
This repository was archived by the owner on Apr 9, 2021. It is now read-only.

Fixed Crash On Searching In Sent/Reviewed Fragments #339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,26 @@ private void getInstanceFromDB() {
String selection;

if (formVersion == null) {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + " IS NULL";
if (getFilterText().length() == 0) {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + " IS NULL";
selectionArgs = new String[]{formId};
} else {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + " IS NULL AND "
+ InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " LIKE ?";
selectionArgs = new String[]{formId, "%" + getFilterText() + "%"};
selection = "AND " + InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " LIKE ?";
}
} else {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + "=?";
if (getFilterText().length() == 0) {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + "=?";
selectionArgs = new String[]{formId, formVersion};
} else {
selectionArgs = new String[]{formId, "%" + getFilterText() + "%"};
selection = "AND " + InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " LIKE ?";
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + "=? AND "
+ InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " LIKE ?";
selectionArgs = new String[]{formId, formVersion, "%" + getFilterText() + "%"};
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,26 @@ private void getInstanceFromDB() {
String selection;

if (formVersion == null) {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + " IS NULL";
if (getFilterText().length() == 0) {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + " IS NULL";
selectionArgs = new String[]{formId};
} else {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + " IS NULL AND "
+ InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " LIKE ?";
selectionArgs = new String[]{formId, "%" + getFilterText() + "%"};
selection = "AND " + InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " LIKE ?";
}
} else {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + "=?";
if (getFilterText().length() == 0) {
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + "=?";
selectionArgs = new String[]{formId, formVersion};
} else {
selectionArgs = new String[]{formId, "%" + getFilterText() + "%"};
selection = "AND " + InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " LIKE ?";
selection = InstanceProviderAPI.InstanceColumns.JR_FORM_ID + "=? AND "
+ InstanceProviderAPI.InstanceColumns.JR_VERSION + "=? AND "
+ InstanceProviderAPI.InstanceColumns.DISPLAY_NAME + " LIKE ?";
selectionArgs = new String[]{formId, formVersion, "%" + getFilterText() + "%"};
}
}

Expand Down