Crash when saving general settings without selecting a language #3010

Closed
opened 7 days ago by mpeter · 4 comments
mpeter commented 7 days ago

Description

If in a fresh profile I change a few settings on the General Settings page and click save, an error box pops up at the bottom left corner of the screen, and opening Vikunja in a new tab will result in a blank, white page.

In the latter case (but probably the former too), the web console will have the following unhandled error logged:

Uncaught (in promise) Error: Unknown variable dynamic import: ./lang/<unset>.json

If I still have the General Settings menu opened in a tab, selecting something from the list and clicking save solves the problem.

Until I explicitly set a language, the dropdown did not have a value selected (or at least the collapsed view of it was blank).

Vikunja Frontend Version

0.20.3

Vikunja API Version

v0.20.1+66-530bb0a63c

Browser and version

Firefox 109.0

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

Before changing a setting:

image

After changing a setting:

image

### Description If in a fresh profile I change a few settings on the General Settings page and click save, an error box pops up at the bottom left corner of the screen, and opening Vikunja in a new tab will result in a blank, white page. In the latter case (but probably the former too), the web console will have the following unhandled error logged: ``` Uncaught (in promise) Error: Unknown variable dynamic import: ./lang/<unset>.json ``` If I still have the General Settings menu opened in a tab, selecting something from the list and clicking save solves the problem. Until I explicitly set a language, the dropdown did not have a value selected (or at least the collapsed view of it was blank). ### Vikunja Frontend Version 0.20.3 ### Vikunja API Version v0.20.1+66-530bb0a63c ### Browser and version Firefox 109.0 ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots Before changing a setting: ![image](/attachments/fad7c24d-9b06-4d57-a835-9b1f9493824d) After changing a setting: ![image](/attachments/8fd304bf-281d-42f9-a22c-021660b43c69)
112 KiB
105 KiB
mpeter added the kind/bug label 7 days ago
konrad commented 6 days ago
Owner

It's interesting you were able to create an account without a language set. By default, it uses the language you set in the browser. Even when logging the user in it will check if you have a language saved and then save that.

It's interesting you were able to create an account without a language set. By default, it uses the language you set in the browser. Even when logging the user in it will check if you have a language saved and then save that.
konrad commented 6 days ago
Owner

Does the user have a language saved on the db?

The time zone should be set as well but isn't in your screenshot.

Does the user have a language saved on the db? The time zone should be set as well but isn't in your screenshot.
mpeter commented 6 days ago
Poster

I have made a dump with mysqldump -u root -p vikunja to check, and it seems they arent. This is in the the place of the language: '<unset>'
And this is in the place of the time zone: '<time zone set at service.timezone>'

This is the full record for the user:

(3,'','asdasd','$2a$11$gdBpyNMw3QeDPbIbcDKNsuFWjr5
V2PA7IA8YeRf8p8voimfUoEqZS','asd@asd.nodomain',0,'initials',0,'local','',0,0,0,1,'9:00',0,1,'<unset>','<time zone set at service.timezone>',NULL,NULL,0,'2023-01-25 15:50:22','2023-01-25 15:50:22')

The value of the language cell seemed very familiar, so I checked my config.yml file.
It seems this is partly on me: I use this as the base for my configuration, and I have left defaultsettings.language and defaultsettings.timezone the way it was originally.
Honestly I don't know what I expected from leaving them that way.

I have made a dump with `mysqldump -u root -p vikunja` to check, and it seems they arent. This is in the the place of the language: `'<unset>'` And this is in the place of the time zone: `'<time zone set at service.timezone>'` This is the full record for the user: ```SQL (3,'','asdasd','$2a$11$gdBpyNMw3QeDPbIbcDKNsuFWjr5 V2PA7IA8YeRf8p8voimfUoEqZS','asd@asd.nodomain',0,'initials',0,'local','',0,0,0,1,'9:00',0,1,'<unset>','<time zone set at service.timezone>',NULL,NULL,0,'2023-01-25 15:50:22','2023-01-25 15:50:22') ``` The value of the language cell seemed very familiar, so I checked my config.yml file. It seems this is partly on me: I use [this](https://kolaente.dev/vikunja/api/src/branch/main/config.yml.sample) as the base for my configuration, and I have left `defaultsettings.language` and `defaultsettings.timezone` the way it was originally. Honestly I don't know what I expected from leaving them that way.
konrad commented 6 days ago
Owner

Yeah that looks like it is the cause here. To fix this, set the language and timezone to null in the database, then reload the frontend. And if you don't want to set the default settings in the server config file, remove the values or comment them out.

Yeah that looks like it is the cause here. To fix this, set the language and timezone to `null` in the database, then reload the frontend. And if you don't want to set the default settings in the server config file, remove the values or comment them out.
konrad closed this issue 6 days ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/frontend#3010
Loading…
There is no content yet.