mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
Handle not having any QU in LocalizationService (fixes #1783)
This commit is contained in:
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
### General
|
### General
|
||||||
|
|
||||||
- xxx
|
- Fixed an server error (on every page) when not having any quantity unit
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
|
@@ -197,6 +197,8 @@ class LocalizationService
|
|||||||
$this->Translator = new Translator();
|
$this->Translator = new Translator();
|
||||||
$this->Translator->loadTranslations($this->Po);
|
$this->Translator->loadTranslations($this->Po);
|
||||||
|
|
||||||
|
$this->PoQu = new Translations();
|
||||||
|
|
||||||
$quantityUnits = null;
|
$quantityUnits = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -209,7 +211,6 @@ class LocalizationService
|
|||||||
|
|
||||||
if ($quantityUnits !== null)
|
if ($quantityUnits !== null)
|
||||||
{
|
{
|
||||||
$this->PoQu = new Translations();
|
|
||||||
$this->PoQu->setHeader(Translations::HEADER_PLURAL, $this->Po->getHeader(Translations::HEADER_PLURAL));
|
$this->PoQu->setHeader(Translations::HEADER_PLURAL, $this->Po->getHeader(Translations::HEADER_PLURAL));
|
||||||
|
|
||||||
foreach ($quantityUnits as $quantityUnit)
|
foreach ($quantityUnits as $quantityUnit)
|
||||||
|
Reference in New Issue
Block a user