Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2] Languagefilter: Add message when no content language is published #43232

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions administrator/language/en-GB/plg_system_languagefilter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

PLG_SYSTEM_LANGUAGEFILTER="System - Language Filter"
PLG_SYSTEM_LANGUAGEFILTER_BROWSER_SETTINGS="Browser Settings"
PLG_SYSTEM_LANGUAGEFILTER_ERROR_NO_CONTENT_LANGUAGE="You have no content language published, but have enabled the Language Filter plugin. This will result in numerous errors!"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_LABEL="Add Alternate Meta Tags"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_AUTOMATIC_CHANGE_LABEL="Automatic Language Change"
PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_LABEL="Cookie Lifetime"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Joomla\CMS\Language\LanguageFactoryInterface;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Router\Router;
Expand Down Expand Up @@ -158,6 +159,11 @@ public function __construct(
}
}
}

if (!\count($this->sefs)) {
$this->loadLanguage();
$app->enqueueMessage(Text::_('PLG_SYSTEM_LANGUAGEFILTER_ERROR_NO_CONTENT_LANGUAGE'), 'error');
}
}

/**
Expand Down