I uploaded a few pictures a few days ago using the latest version of the app. An automatic category to sort the pictures by date was added to each of them, which is cool, but the category does not exist:
See eg:
https://commons.wikimedia.org/wiki/File:Krucifix_na_z%C3%A1pad_od_Zl%C3%AD%C4%8Dka.jpg
Also the app thinks I uploaded them on 10th August 2020 rather then 2019... could that be a problem with my phone, though?
Hmm, I've just tested the alpha and found no issue with the date taken - https://commons.wikimedia.org/wiki/File:San_Gimignano_2.jpg . The hidden category https://commons.wikimedia.org/wiki/Category:Photographs_taken_on_2019-07-05 does exist for me - I suspect the reason it doesn't exist for you is because the date is in 2020. :)
Is anyone else able to reproduce this? Vojtech does your phone display the current date correctly to you (aside from this app)?
Do we really need this date category?
Maybe the bug is that the date format varies with the locale?
I don't think the category was made by us, it seems to be added to Upload Wizard uploads too, i.e. https://commons.wikimedia.org/wiki/File:Kirkkokatu_27_Raahe_20190705.jpg
Then the easiest is probably to create a Phabricator ticket and forget about it :-)
I don't think the problem is with the category creation though... it seems to be a side effect of the wrong upload date. It makes sense for uploads made "in the future" to not have the category created yet.
A few examples found:
Photographs taken on 10. 08. 20 (Czech locale)Photographs taken on 27/08/2019 (Nepali locale)Photographs taken on 2019-07-05 (English locale) ← Only this one is validSo, instead of writing the date using the user's locale, we should code it explicitly as year + "-" + month + "-" + day.
@nicolas-raoul , is this the same issue as the one reported in our public forum? If so (and the dates are indeed wrong for all non-English locales), we should prioritize this fix since it's a big problem.
Wrong dates appear in the files description pages due to the application
Example of correction:
https://commons.wikimedia.org/w/index.php?title=File:The_Donkey_Tail_Plant.jpg&diff=prev&oldid=363578552&diffmode=source
@misaochan Yes, I am pretty sure it is, and I share your view that it is a priority issue, because it forces Commons people to fix our mess, giving the app a bad reputation.
@nicolas-raoul Agreed. Unfortunately I am away for 2 weeks starting this Saturday, and by the time I get back 2.12 should be close to ready, which means that a hotfix may not make sense. :/ Or alternatively, could you and @ashishkumar468 collaborate on this, where he sends a hotfix to our 2.11-release branch, and you do the 2.11.1 hotfix release when it is ready? You'd just need to release the 2.11-release branch with the addition of his PR, don't take anything from master.
I am looking for a new apartment right now so I have to focus on that, unfortunately :'-/ But I can review a pull request :-)
Ah, okay. I'll try to release 2.11.1 with the hotfix as soon as I get back, then.
I will look into the issue and raise a PR for the same :)
I am not able to reproduce this, I can see the actual date for both Hindi & English Locales. Is there a specific way to produce this ?
@ashishkumar0207
Maybe Hindi & English locales use the same date format.
Would you mind trying Czech or Nepali locale?
@nicolas-raoul Sure, I will try that .
It seems this is a fairly general phenomenon... just found out the same bug appears in pictures from another Czech uploader: https://commons.wikimedia.org/wiki/File:Plastika_Prost%C5%99en%C3%BD_st%C5%AFl_v_ulici_Na_Mlejnku.jpg
So it could really be due to language settings.
I can't reply this bug with my phone, with Czech, Nepali, English or Russian locale.
@PavelAplevich Thanks for trying! Could you please post the URL to the images you uploaded in each locale? Thanks :-)
https://commons.wikimedia.beta.wmflabs.org/wiki/File%3AMemori%C3%A1l.jpg
This image upload now. But on "Summary" i see "6 August 2019"
That's with the Czech locale right?
Could you please try uploading to the production server instead? Using the prod flavour.
I undestand. This is the date the file was created on my device.
@nicolas-raoul
I did't understand you( Sorry, tell me more what I need to do
What the "prod flavour and production server?")
I mean, please run ./gradlew installProdDebug (or select the productionDebug flavour in Android Studio, as described at https://stackoverflow.com/a/27549441/226958). :-)
I run build with "prod" and "debug" on my phone and app doesn't work :D
Doesn’t works as in what error are you getting?
On Mon, 9 Sep 2019 at 1:13 PM, PavelAplevich notifications@github.com
wrote:
I run build with "prod" and "debug" on my phone and app doesn't work :D
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/commons-app/apps-android-commons/issues/3126?email_source=notifications&email_token=AEESAKVASCQDTE6FQXNP5YDQIX5A5A5CNFSM4ILDJFQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6GRL2A#issuecomment-529339880,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEESAKWEO7IBOPEJCKECOZDQIX5A5ANCNFSM4ILDJFQQ
.>
Thanking You,
Ashish Kumar
09-09 10:53:14.164 17895-17895/? E/libprocessgroup: failed to make and chown /acct/uid_10065: Read-only file system
--------- beginning of main
09-09 10:53:14.164 17895-17895/? W/Zygote: createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
09-09 10:53:14.165 17895-17895/? I/art: Not late-enabling -Xcheck:jni (already on)
09-09 10:53:14.761 17895-17895/fr.free.nrw.commons.beta I/ACRA: ACRA is enabled for fr.free.nrw.commons.beta, initializing...
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: init start
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: adding system library source: /vendor/lib
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: adding system library source: /system/lib
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: adding application source: com.facebook.soloader.DirectorySoSource[root = /data/app/fr.free.nrw.commons.beta-1/lib/x86 flags = 0]
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: adding backup source from : com.facebook.soloader.ApkSoSource[root = /data/data/fr.free.nrw.commons.beta/lib-main flags = 1]
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/lib flags = 2]
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /system/vendor/lib flags = 2]
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: Preparing SO source: com.facebook.soloader.DirectorySoSource[root = /data/app/fr.free.nrw.commons.beta-1/lib/x86 flags = 0]
09-09 10:53:14.780 17895-17895/fr.free.nrw.commons.beta D/SoLoader: Preparing SO source: com.facebook.soloader.ApkSoSource[root = /data/data/fr.free.nrw.commons.beta/lib-main flags = 1]
09-09 10:53:14.781 17895-17895/fr.free.nrw.commons.beta V/fb-UnpackingSoSource: locked dso store /data/data/fr.free.nrw.commons.beta/lib-main
09-09 10:53:14.781 17895-17895/fr.free.nrw.commons.beta I/fb-UnpackingSoSource: dso store is up-to-date: /data/data/fr.free.nrw.commons.beta/lib-main
09-09 10:53:14.781 17895-17895/fr.free.nrw.commons.beta V/fb-UnpackingSoSource: releasing dso store lock for /data/data/fr.free.nrw.commons.beta/lib-main
09-09 10:53:14.781 17895-17895/fr.free.nrw.commons.beta D/SoLoader: init finish: 4 SO sources prepared
09-09 10:53:14.781 17895-17895/fr.free.nrw.commons.beta D/SoLoader: init exiting
09-09 10:53:14.802 17895-17895/fr.free.nrw.commons.beta D/AndroidRuntime: Shutting down VM
09-09 10:53:14.802 17895-17895/fr.free.nrw.commons.beta E/ACRA: ACRA caught a RuntimeException for fr.free.nrw.commons.beta
java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.free.nrw.commons.beta/fr.free.nrw.commons.auth.LoginActivity}: android.view.InflateException: Binary XML file line #40: Error inflating class TextView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: android.view.InflateException: Binary XML file line #40: Error inflating class TextView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
at android.app.Activity.setContentView(Activity.java:2145)
at fr.free.nrw.commons.auth.LoginActivity.onCreate(LoginActivity.java:127)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.appcompat.widget.AppCompatBackgroundHelper.onSetBackgroundDrawable$130e17e7()' on a null object reference
at androidx.appcompat.widget.AppCompatTextView.setBackgroundDrawable(AppCompatTextView.java:119)
at android.view.View.setBackground(View.java:16226)
at android.view.View.<init>(View.java:4103)
at android.widget.TextView.<init>(TextView.java:637)
at android.widget.TextView.<init>(TextView.java:632)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95)
at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:91)
at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:182)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1266)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1316)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
at android.app.Activity.setContentView(Activity.java:2145)
at fr.free.nrw.commons.auth.LoginActivity.onCreate(LoginActivity.java:127)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
09-09 10:53:15.201 17895-17895/fr.free.nrw.commons.beta I/Process: Sending signal. PID: 17895 SIG: 9
@PavelAplevich Can you try using clean project/ invalidate cache restart, it seems to work for me.
All my steps:
Choose "Build"->"Edit Flavours"->"prod"
"Edit Build Types"->"debug"
Restart Studio
Delete all cashe and app from my phone
Restart phone
Delete cashe and app from emulator
Run app on phone and emulator. App doesn't work(
This seems to be a separate issue, please create an issue for the same. We will take it from there.
@ashishkumar468 I done) I update my gradle to 3.5.0 version and all works.
@nicolas-raoul You's URL on prodDebug build
Czech locale
https://commons.wikimedia.org/wiki/File%3AOrigami_3.jpg
Russian locale
The date seems looks correct to me, @nicolas-raoul. @PavelAplevich has also uploaded the image in Czech locale. Am I missing something, is there a specific way to reproduce this?.@PavelAplevich I would recommend not to upload dummy images on prod, your account might get flagged :P
_(sorry please disregard the comment I posted a few minutes ago, I had not refreshed my browser)_
https://commons.wikimedia.org/wiki/File%3AOrigami_3.jpg (Czech locale) has a wrong date format: {{According to EXIF data|31. 10. 2018}}
https://commons.wikimedia.org/wiki/File%3ACaf.jpg (Russian locale) has a correct date format: {{date|2019|7|28}}
So, congratulations for reproducing the problem :-)
Now, please find in the source code the places where description is generated, put breakpoints, and run in debug mode to understand better how the date is generated, then tell us :-)
@nicolas-raoul Ok, I will do it. Give me some time..
@nicolas-raoul
https://commons.wikimedia.org/wiki/File%3AUruccha.jpg
This file has wrong date too, right?
@PavelAplevich The date of that file is {{According to EXIF data|04.09.2019}} which is wrong too, yes.
By the way, rather than uploading random pictures and then nominating them for deletion, I suggest you upload these pictures (pick randomly as some have been uploaded already):
https://drive.google.com/drive/folders/1YeYGelmhKbpO_OPAKLT-S4Cw-rsbCG6V?usp=sharing
@nicolas-raoul Thank you, for pictures.
I think, the problem is:
Photos with correct date i download from my messenger. They date based on date of creating file.
Photos with wrong date i did it by myself, on my phone. They date based on EXIF.
As the result - EXIF work's wrong.
What do think about this?
There is one line where the template is filled: https://github.com/commons-app/apps-android-commons/blob/bb570a5afc32e13086460b9aa536112107c620f2/app/src/main/java/fr/free/nrw/commons/contributions/Contribution.java#L205
Either _dateCreated_ is not in the correct format or the formatter _getDateStringWithSkeletonPattern_ does not work properly.
@PavelAplevich Using EXIF data is fine as far as I'm aware. The problem here is with the date templates being sent, which are in the wrong format. I think https://github.com/commons-app/apps-android-commons/issues/3126#issuecomment-525686311 explains what needs to be done. :)
@PavelAplevich would you happen to have an update on this? Sorry for the rush, but this is a bit of a high-priority issue. :)
@misaochan
This is Czech locale image
https://commons.wikimedia.beta.wmflabs.org/wiki/File%3AKran.jpg
This is Russian locale image
https://commons.wikimedia.beta.wmflabs.org/wiki/File%3A%D0%A3%D1%80%D1%83%D1%87%D1%8C%D0%B5.jpg
https://commons.wikimedia.beta.wmflabs.org/wiki/File%3A%D0%93%D0%BE%D1%80%D0%BE%D0%B4.jpg
This is UK locale image
https://commons.wikimedia.beta.wmflabs.org/wiki/File%3ACity.jpg
Could you please tell me, which variant is correct?
@PavelAplevich none of them are correct. We need the format "2019-07-05", which has the year first.
Take a look at the template for the images you linked - to view the format of the template, you can go to Summary > edit. The first file you linked, for instance, says:
== {{int:filedesc}} ==
{{Information
|description={{cs|1=test}}
|source={{own}}
|author=[[User:Roc|Roc]]
|date={{According to EXIF data|13. 03. 2019}}
}}
A possible solution is to code it explicitly as year + "-" + month + "-" + day.
Thanks for the PR @PavelAplevich , the same is merged with master, works for me. Can someone else also verify the same ?
Thanks so much @PavelAplevich ! :) @ashishkumar468 I am trying to review the results, but it seems like the Commons Beta DB is down at the moment? I'll try again later.
Issue is fixed for me. Thanks @PavelAplevich !
With further testing, I've found that uploaded pictures without EXIF data don't display the date at all in the summary: https://commons.wikimedia.org/wiki/File:Byron_lighthouse_2.jpg
This is quite strange since https://commons.wikimedia.beta.wmflabs.org/w/index.php?title=File:NoEXIF.jpg displays the date perfectly fine. And their date templates are exactly the same. I don't remember this happening in the previous versions.
Is there a difference between how Commons Beta and the real Commons handles display of date templates?
@misaochan
I see the correct information both there and there
Do you see the date in the summary? I don't mean Summary > Edit, but in the user-facing summary. Personally for https://commons.wikimedia.org/wiki/File:Byron_lighthouse_2.jpg this is what I see:
Description | English: Lighthouse at Cape Byron
Date |
Source | Own work
Author | misaochan2
Yes, i see.. Any ideas, what the problem is?
I'm not sure. :( Trying to figure it out myself too. @nicolas-raoul @Aschroet any idea?
@Achim55 Hope you don't mind a quick Q - do you know why the date field in the user-facing summary of https://commons.wikimedia.org/wiki/File:Byron_lighthouse_2.jpg is blank, even though the template is filled with |date={{date|2019-09-09}}?
@misaochan I tried in various locales, and the user-facing summary is displaying the proper dates. Perhaps you should try reloading your browser (or try reloading after clearing your cache).
@misaochan I see this date too.

I fixed it and left a note on your talk page. The behavior of {{date}} may differ on different projects.
In general the date field of file pages on Commons should not use the {{date}} template but be either
|date=yyyy-mm-dd
|date=yyyy-mm
|date=yyyy
or
|date={{According to EXIF data|yyyy-mm-dd}}
or for special cases like centuries
|date={{Other date|...some special data...}}
Best, Achim
Thanks @Achim55 , I'll modify the template that we send accordingly. :)
Most helpful comment
A few examples found:
Photographs taken on 10. 08. 20(Czech locale)Photographs taken on 27/08/2019(Nepali locale)Photographs taken on 2019-07-05(English locale) ← Only this one is validSo, instead of writing the date using the user's locale, we should code it explicitly as
year + "-" + month + "-" + day.