fix: Web Search settings do not save while web search is off (#32840)

With web search off, clicking Save on the Web Search settings page jumped to an empty search engine field and saved nothing. That happened with no engine picked, which is how a fresh install starts, and also when an engine picked earlier was missing its own details, such as the SearXNG query URL. Admins could not change the Web Loader settings, which apply whenever a user attaches a web page, without filling in a search engine first. The engine and its details are now only required while web search is turned on.

Fixes #32831
This commit is contained in:
Classic298 2026-10-21 18:51:44 +02:00 • committed by GitHub
parent ce7f87a750
commit cc6de63bc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -219,7 +219,7 @@
<SettingsSelect
bind:value={webConfig.WEB_SEARCH_ENGINE}
placeholder={$i18n.t('Select a engine')}
required
required={webConfig.ENABLE_WEB_SEARCH}
>
<option disabled selected value="">{$i18n.t('Select a engine')}</option>
{#each webSearchEngines as engine}
@ -306,7 +306,7 @@
placeholder={$i18n.t('Enter Searxng Query URL')}
bind:value={webConfig.SEARXNG_QUERY_URL}
autocomplete="off"
required
required={webConfig.ENABLE_WEB_SEARCH}
/>
</div>
</div>
@ -324,7 +324,7 @@
placeholder={$i18n.t('Enter Searxng search language')}
bind:value={webConfig.SEARXNG_LANGUAGE}
autocomplete="off"
required
required={webConfig.ENABLE_WEB_SEARCH}
/>
</div>
</div>
@ -361,7 +361,7 @@
class="w-full rounded-lg border border-gray-100/50 bg-gray-50/40 px-2 py-1.5 text-xs text-gray-700 outline-hidden transition-colors focus:border-blue-400 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-gray-300 dark:focus:border-blue-500"
placeholder={$i18n.t('Enter Yacy Username')}
bind:value={webConfig.YACY_USERNAME}
required
required={webConfig.ENABLE_WEB_SEARCH}
/>
</div>
@ -1113,7 +1113,7 @@
placeholder={$i18n.t('Enter OpenSERP Base URL')}
bind:value={webConfig.OPENSERP_BASE_URL}
autocomplete="off"
required
required={webConfig.ENABLE_WEB_SEARCH}
/>
</div>
</div>