-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Translated URL ist not stored in translated static page file #91
Comments
@mjauvin seeing a lot of people complain about this after 1.2.7 |
I've heard of two so far and I said (on discord) I'd look into it when I get time. |
@der-On I cannot reproduce this bug. It is intended that translated URL be stored in the default language page only, and that does not prevent static pages menu items title/URL from being translated. The only thing stored in the translated static pages is the translated CONTENT. Titles and URLs are stored in the DEFAULT language static page under the viewBag as localeTitle[xx] / localeUrl[xx] Note: there was a fix added in Winter.Translate that restored previous behavior as Winter Core 1.2.7 made a change in Event binding that broke translations. So make sure you use latest Winter.Translate plugin (2.1.7) and that you clear the cache (artisan cache:clear). |
Ok, I was able to reproduce the bug (I had previously changed the bindEventOnce() calls to bindEvent()). So, as stated before on Discord, the following PR broke things in translate plugin: So until I issue a fix for Winter.Translate, please revert above PR in your local install and CLEAR CACHE. |
@der-On a temporary fix is below for Winter.Translate (without changing Winter Storm): diff --git a/behaviors/TranslatablePageUrl.php b/behaviors/TranslatablePageUrl.php
index 11fe845..30341df 100644
--- a/behaviors/TranslatablePageUrl.php
+++ b/behaviors/TranslatablePageUrl.php
@@ -48,7 +48,7 @@ class TranslatablePageUrl extends ExtensionBase
$this->initTranslatableContext();
- $this->model->bindEvent('model.afterFetch', function() {
+ $this->model->bindEventOnce('model.afterFetch', function() {
$this->translatableDefaultUrl = $this->getModelUrl();
if (!App::runningInBackend()) { |
When setting a translated URL in a static page the url will only be stored in the original static page file as
localeUrl[:locale]
but not in the translated static page file underurl
.Storing it in the translated static page file is however required for menu items to correctly resolve translated static page URLs.
The text was updated successfully, but these errors were encountered: