I've created a new page through the CMS panel. While trying to visit it on Chrome browser, I get 404 error. Page is working fine on Mozilla Firefox.
I've done some research and found where the error occurs. Method findPagesByURL() of PageRepository class gets into this condition:
Page is found in database, but app()->getLocale() and config('cms.default-language') return different values. I have Polish language ('pl') set in both app.locale config and cms.default-language config, but after printing app()->getLocale() and exiting I get an weird long string starting with 'eyJpdiI6InFreU01YXZVZWU1...'. In other places of my app returned language is correct, i.e. 'pl'. But when trying to show a CMS page, the method from PageRepository is trying to get the page from TranslationRepo and returns null, even though both app locale and CMS locale are set to 'pl'.
Clearing config, cache and caching config didn't help.
I've created a new page through the CMS panel. While trying to visit it on Chrome browser, I get 404 error. Page is working fine on Mozilla Firefox. I've done some research and found where the error occurs. Method findPagesByURL() of PageRepository class gets into this condition:
if ($page && app()->getLocale() !== config('cms.default-language')) { $page = $this->translationRepo->findByEntityId($page->id, 'Grafite\Cms\Models\Page'); }
Page is found in database, but
app()->getLocale()
andconfig('cms.default-language')
return different values. I have Polish language ('pl') set in both app.locale config and cms.default-language config, but after printingapp()->getLocale()
and exiting I get an weird long string starting with 'eyJpdiI6InFreU01YXZVZWU1...'. In other places of my app returned language is correct, i.e. 'pl'. But when trying to show a CMS page, the method from PageRepository is trying to get the page from TranslationRepo and returns null, even though both app locale and CMS locale are set to 'pl'. Clearing config, cache and caching config didn't help.