- Registriert
- 30. Apr. 2011
- Beiträge
- 6.205
- Punkte
- 523
- XF Version
- 2.3.4
- XF Instanz
- Hosting
- PHP-Version
- 8.3.x
- MySQL/MariaDB
- 10.11.x
- Provider/Hoster
- Netcup & 24fire
Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
ErrorException: [E_NOTICE] Undefined index: xd_user_selectable - src/XF/Language.php:383
#0 src/XF/Language.php(383): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/www/katze...', 383, Array)
#1 src/XF/Language.php(388): XF\Language->offsetGet('xd_user_selecta...')
#2 src/addons/XenDACH/LimitLanguageUsage/XF/Pub/Controller/Account.php(19): XF\Language->__get('xd_user_selecta...')
#3 src/addons/SV/AlertImprovements/XF/Pub/Controller/Account.php(21): XenDACH\LimitLanguageUsage\XF\Pub\Controller\Account->preferencesSaveProcess(Object(xenMade\LAU\XF\Entity\User))
#4 src/XF/Pub/Controller/Account.php(311): SV\AlertImprovements\XF\Pub\Controller\Account->preferencesSaveProcess(Object(xenMade\LAU\XF\Entity\User))
#5 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Account->actionPreferences(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Preferences', 'json', Object(XF\Mvc\ParameterBag), 'account', Object(SV\AlertImprovements\XF\Pub\Controller\Account), NULL)
#7 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#8 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#9 src/XF.php(329): XF\App->run()
#10 index.php(13): XF::runApp('XF\\Pub\\App')
#11 {main}
das ist ganz einfach. In der entsprechenden TM mit dem Key "xd_language_list_limitLanguageUsage"So in der Richtung wenn Sprache Default, dann Toogle disable..
<xf:if is="$defaultLanguageId != $language.language_id">
<xf:toggle name="xd_user_selectable[{$language.language_id}]"
selected="$language.xd_user_selectable"
class="dataList-cell--separated u-hideMedium"
submit="true"
tooltip="{{ phrase('enable_disable_x', {'title': $language.title}) }}" />
<xf:else />
<xf:cell> </xf:cell>
</xf:if>
$0
<?php
namespace XenDACH\LimitLanguageUsage\XF\Admin\Controller;
class Language extends XFCP_Language
{
protected function languageSaveProcess(\XF\Entity\Language $language)
{
$form = parent::languageSaveProcess($language);
if (!$this->filter('xd_user_selectable', 'bool') && $language->language_id == $this->options()->defaultLanguageId)
{
$form->logError(\XF::phrase('xd_it_is_not_possible_to_prevent_users_selecting_the_default_language_limitLanguageUsage'));
}
else
{
$form->setup(function() use ($language) {
$language->xd_user_selectable = $this->filter('xd_user_selectable', 'bool');
});
}
return $form;
}
public function actionToggle()
{
$input = $this->filter([
'default_language_id' => 'int',
'xd_user_selectable' => 'array'
]);
$languageDefault = $this->assertLanguageExists($input['default_language_id']);
if (!$languageDefault->xd_user_selectable) {
return $this->error(\XF::phrase('xd_it_is_not_possible_to_prevent_users_selecting_the_default_language_limitLanguageUsage'));
}
foreach ($input['xd_user_selectable'] as $key => $value)
{
$languageSelectable = $this->assertLanguageExists($key);
if ($languageSelectable->language_id == $languageDefault->language_id && !$value)
return $this->error(\XF::phrase('xd_it_is_not_possible_to_prevent_users_selecting_the_default_language_limitLanguageUsage'));
}
parent::actionToggle();
/** @var \XF\ControllerPlugin\Toggle $plugin */
$plugin = $this->plugin('XF:Toggle');
return $plugin->actionToggle('XF:Language', 'xd_user_selectable');
}
}
Ich bekomme seit der Aktualisierung gelegentlich Fehlermeldungen.
Code:ErrorException: [E_NOTICE] Undefined index: xd_user_selectable - src/XF/Language.php:383
Code:#0 src/XF/Language.php(383): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/www/katze...', 383, Array) #1 src/XF/Language.php(388): XF\Language->offsetGet('xd_user_selecta...') #2 src/addons/XenDACH/LimitLanguageUsage/XF/Pub/Controller/Account.php(19): XF\Language->__get('xd_user_selecta...') #3 src/addons/SV/AlertImprovements/XF/Pub/Controller/Account.php(21): XenDACH\LimitLanguageUsage\XF\Pub\Controller\Account->preferencesSaveProcess(Object(xenMade\LAU\XF\Entity\User)) #4 src/XF/Pub/Controller/Account.php(311): SV\AlertImprovements\XF\Pub\Controller\Account->preferencesSaveProcess(Object(xenMade\LAU\XF\Entity\User)) #5 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Account->actionPreferences(Object(XF\Mvc\ParameterBag)) #6 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Preferences', 'json', Object(XF\Mvc\ParameterBag), 'account', Object(SV\AlertImprovements\XF\Pub\Controller\Account), NULL) #7 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch)) #8 src/XF/App.php(1931): XF\Mvc\Dispatcher->run() #9 src/XF.php(329): XF\App->run() #10 index.php(13): XF::runApp('XF\\Pub\\App') #11 {main}
[Add] Prevent for enabling/disabling default language during editing language
[Add] Prevent for disabling default language in ACP language list
Wieder einmal danke an @nocte für die tatkräftige Unterstützung..
#0 src/XF/Language.php(383): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/www/netzk...', 383, Array)
#1 src/XF/Language.php(388): XF\Language->offsetGet('xd_user_selecta...')
#2 src/addons/XenDACH/LimitLanguageUsage/XF/Pub/Controller/Account.php(19): XF\Language->__get('xd_user_selecta...')
#3 src/XF/Pub/Controller/Account.php(311): XenDACH\LimitLanguageUsage\XF\Pub\Controller\Account->preferencesSaveProcess(Object(xenMade\LAU\XF\Entity\User))
#4 src/XF/Mvc/Dispatcher.php(249): XF\Pub\Controller\Account->actionPreferences(Object(XF\Mvc\ParameterBag))
#5 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Preferences', 'json', Object(XF\Mvc\ParameterBag), 'account', Object(XenDACH\LimitLanguageUsage\XF\Pub\Controller\Account), NULL)
#6 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#7 src/XF/App.php(1934): XF\Mvc\Dispatcher->run()
#8 src/XF.php(333): XF\App->run()
#9 index.php(13): XF::runApp('XF\\Pub\\App')
#10 {main}
array(4) {
["url"] => string(20) "/account/preferences"
["referrer"] => string(45) "https://www.netzkatzen.de/account/preferences"
["_GET"] => array(1) {
["/account/preferences"] => string(0) ""
}
["_POST"] => array(8) {
["user"] => array(3) {
["style_id"] => string(1) "0"
["language_id"] => string(1) "4"
["timezone"] => string(16) "Europe/Amsterdam"
}
["option"] => array(5) {
["receive_admin_email"] => string(1) "1"
["email_on_conversation"] => string(1) "1"
["creation_watch_state"] => string(11) "watch_email"
["interaction_watch_state"] => string(11) "watch_email"
["content_show_signature"] => string(1) "1"
}
["custom_fields"] => array(1) {
["erweitertes_men_neue"] => string(2) "ja"
}
["alert"] => array(29) {
["post_insert"] => string(1) "1"
["post_mention"] => string(1) "1"
["post_like"] => string(1) "1"
["xfmg_media_insert"] => string(1) "1"
["xfmg_media_mention"] => string(1) "1"
["xfmg_media_like"] => string(1) "1"
["xfmg_album_share_view"] => string(1) "1"
["xfmg_album_share_add"] => string(1) "1"
["xfmg_album_mention"] => string(1) "1"
["xfmg_album_like"] => string(1) "1"
["xfmg_comment_insert"] => string(1) "1"
["xfmg_comment_quote"] => string(1) "1"
["xfmg_comment_mention"] => string(1) "1"
["xfmg_comment_like"] => string(1) "1"
["xfmg_rating_insert"] => string(1) "1"
["ld_link_insert"] => string(1) "1"
["ld_link_comment_insert"] => string(1) "1"
["ld_link_comment_mention"] => string(1) "1"
["ld_link_comment_like"] => string(1) "1"
["ld_link_rating_rate"] => string(1) "1"
["profile_post_insert"] => string(1) "1"
["profile_post_mention"] => string(1) "1"
["profile_post_like"] => string(1) "1"
["profile_post_comment_your_profile"] => string(1) "1"
["profile_post_comment_your_post"] => string(1) "1"
["profile_post_comment_other_commenter"] => string(1) "1"
["profile_post_comment_like"] => string(1) "1"
["conversation_message_like"] => string(1) "1"
["user_following"] => string(1) "1"
}
["_xfToken"] => string(8) "********"
["_xfRequestUri"] => string(20) "/account/preferences"
["_xfWithData"] => string(1) "1"
["_xfResponseType"] => string(4) "json"
}
}
"invalid style" ist natürlich ein Blödsinn, dürfte mein Fehler sein. Gemeint ist "invalid language". Du speicherst language_id 4 laut deinem Post. Ist die Sprache mit der ID 4 "selectable"?Seit dem Update 2.0.12 bekomme ich in "/account/preferences" die Meldung "invalid style" angezeigt. Die Phrase ist Teil dieses Addons.
Laut Screenshot wären alle 4 Sprachen verfügbar.Die language_id 4 ist die einzig verfügbare Sprache.
[Fix] Issue with language caching ([XenDACH] LimitLanguageUsage)
Frische Luft??Warum, so meinst du, habe ich mit den 2.1 Sprachpaketen auf der grünen Wiese begonnen.
Wir verwenden essentielle Cookies, damit diese Website funktioniert, und optionale Cookies, um den Komfort bei der Nutzung zu verbessern.
Siehe weitere Informationen und konfiguriere deine Einstellungen