clearing language is possible in /app/${appid}/overview . causing error when save #8078

Closed
opened 2026-02-21 18:23:48 -05:00 by yindo · 1 comment
Owner

Originally created by @aplio on GitHub (Feb 8, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. go to /app/${anyId}/overview
  2. open setting for an app
    e.g.
    Image
  3. clear language by hitting x
  4. saving with that will cause error
    e.g.
    Image

✔️ Expected Behavior

language should be not clearable

Actual Behavior

language can be cleared, causing error when saved

Originally created by @aplio on GitHub (Feb 8, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. go to `/app/${anyId}/overview` 2. open setting for an app e.g. ![Image](https://github.com/user-attachments/assets/48efe917-25f7-42bd-b675-27a33da6f143) 3. clear language by hitting `x` 4. saving with that will cause error e.g. ![Image](https://github.com/user-attachments/assets/a1a7c7fd-cc09-475e-91b6-46f5ab4f2fbc) ### ✔️ Expected Behavior language should be not clearable ### ❌ Actual Behavior language can be cleared, causing error when saved
yindo added the 🐞 buggood first issue labels 2026-02-21 18:23:48 -05:00
yindo closed this issue 2026-02-21 18:23:48 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 8, 2025):

Hey @aplio! 👋 I'm here to help you with bug fixes, answer your questions, and guide you on becoming a contributor. Let's work together to resolve the issue you're facing!

To address the issue of the language field being clearable in the /app/${appid}/overview section and causing errors when saving in Dify version 0.15.3, you should ensure that the default_language is correctly set and maintained in the component's state. The useEffect hook is used to initialize the language state with default_language from appInfo.site. Make sure this state is not unintentionally reset or cleared elsewhere in the component.

Here's the relevant part of the code that handles the language setting:

const [language, setLanguage] = useState(default_language);

useEffect(() => {
  setLanguage(default_language);
}, [appInfo]);

Ensure that the setLanguage function is only called with valid language values and that the default_language is correctly passed and updated in the appInfo object. If the language is being cleared, check for any logic that might be resetting the language state or the appInfo object [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Feb 8, 2025): <!-- Greeting --> Hey @aplio! 👋 I'm here to help you with bug fixes, answer your questions, and guide you on becoming a contributor. Let's work together to resolve the issue you're facing! <!-- Answer --> To address the issue of the language field being clearable in the `/app/${appid}/overview` section and causing errors when saving in Dify version 0.15.3, you should ensure that the `default_language` is correctly set and maintained in the component's state. The `useEffect` hook is used to initialize the `language` state with `default_language` from `appInfo.site`. Make sure this state is not unintentionally reset or cleared elsewhere in the component. Here's the relevant part of the code that handles the language setting: ```tsx const [language, setLanguage] = useState(default_language); useEffect(() => { setLanguage(default_language); }, [appInfo]); ``` Ensure that the `setLanguage` function is only called with valid language values and that the `default_language` is correctly passed and updated in the `appInfo` object. If the language is being cleared, check for any logic that might be resetting the `language` state or the `appInfo` object <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/app/overview/settings/index.tsx)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/59469601-ac72-4cae-9a94-dc98ceaedb0f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/59469601-ac72-4cae-9a94-dc98ceaedb0f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/59469601-ac72-4cae-9a94-dc98ceaedb0f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/59469601-ac72-4cae-9a94-dc98ceaedb0f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/59469601-ac72-4cae-9a94-dc98ceaedb0f?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/59469601-ac72-4cae-9a94-dc98ceaedb0f?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8078