Skip to content

Merge 4.0-release into master #5028

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

Merged
merged 26 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8b75c41
Fix string for custom selector
misaochan Apr 29, 2022
9880d7e
Fix bug #4950 back arrow still present on top-level activity (#4952)
madhurgupta10 May 2, 2022
4edabed
Fix bug #4949 by correctly setting previous db version number (#4956)
madhurgupta10 May 18, 2022
f4414b1
Fix bug #4959 by correctly setting previous db version number and upd…
madhurgupta10 May 20, 2022
9654a8e
Fix bug #4957 (#4961)
madhurgupta10 May 20, 2022
05895c5
Update library to new version that handles older Java VMs
nicolas-raoul May 25, 2022
50b3d2c
Versioning for v4.0.0
misaochan May 28, 2022
e27f5d4
Changelog for v4.0.0
misaochan May 28, 2022
3533b81
Fix bug #4984 Added queries for package name for Android API 30+ (#4987)
madhurgupta10 Jun 3, 2022
18fa717
Update mapbox sdk version (#4989)
madhurgupta10 Jun 8, 2022
66f8f97
Versioning for v4.0.1
misaochan Jun 9, 2022
e5e5a8d
Changelog for v4.0.1
misaochan Jun 9, 2022
d45123d
Remove network type information from NetworkUtils (#4996)
madhurgupta10 Jun 28, 2022
d8e4c03
Fix #4992 invert the equals condition to be null safe (#4995)
madhurgupta10 Jun 28, 2022
5fe1ad8
Fix java.lang.NullPointerException for username in ContributionBounda…
madhurgupta10 Jul 5, 2022
8eb6681
Fix failing tests for PR #5003 (#5004)
madhurgupta10 Jul 6, 2022
bec2680
Update Room DB Version (#5011)
madhurgupta10 Jul 12, 2022
c520024
Fix #5001 (#5010)
madhurgupta10 Jul 12, 2022
cb3094b
Fix DB update issue (#5016)
neslihanturan Jul 18, 2022
98143aa
[WIP] Fix both timezone problem and saved date problem (#5019)
neslihanturan Aug 3, 2022
02df655
Versioning for v4.0.2
misaochan Aug 4, 2022
3f759a8
Changelog for v4.0.2
misaochan Aug 4, 2022
c53befc
Add "Report Violation" menu option (#5025)
madhurgupta10 Aug 5, 2022
23c474b
Versioning for v4.0.3
misaochan Aug 5, 2022
308cce4
Changelog for v4.0.3
misaochan Aug 5, 2022
67eb203
Merge branch 'master' into 4.0-release-copy
madhurgupta10 Aug 6, 2022
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
Prev Previous commit
Next Next commit
Fix DB update issue (#5016)
  • Loading branch information
neslihanturan authored Jul 18, 2022
commit cb3094b51c9940d7eca7e829c1df9a4df6b77ee2
15 changes: 12 additions & 3 deletions app/src/main/java/fr/free/nrw/commons/category/CategoryDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ List<CategoryItem> recentCategories(int limit) {
// fixme add a limit on the original query instead of falling out of the loop?
while (cursor != null && cursor.moveToNext()
&& cursor.getPosition() < limit) {
items.add(new CategoryItem(fromCursor(cursor).getName(),
fromCursor(cursor).getDescription(), fromCursor(cursor).getThumbnail(),
false));
if (fromCursor(cursor).getName() != null ) {
items.add(new CategoryItem(fromCursor(cursor).getName(),
fromCursor(cursor).getDescription(), fromCursor(cursor).getThumbnail(),
false));
}
}
} catch (RemoteException e) {
throw new RuntimeException(e);
Expand Down Expand Up @@ -193,6 +195,13 @@ public static void onUpdate(SQLiteDatabase db, int from, int to) {
onUpdate(db, from, to);
return;
}
if (from == 17) {
db.execSQL("ALTER TABLE categories ADD COLUMN description STRING;");
db.execSQL("ALTER TABLE categories ADD COLUMN thumbnail STRING;");
from++;
onUpdate(db, from, to);
return;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.os.Parcelable
import kotlinx.android.parcel.Parcelize

@Parcelize
data class CategoryItem(val name: String, val description: String,
val thumbnail: String, var isSelected: Boolean) : Parcelable {
data class CategoryItem(val name: String, val description: String?,
val thumbnail: String?, var isSelected: Boolean) : Parcelable {

override fun toString(): String {
return "CategoryItem: '$name'"
Expand Down