Skip to content
Snippets Groups Projects
Unverified Commit 2e6dbaf8 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fix

parent dbd578c5
No related branches found
No related tags found
No related merge requests found
...@@ -103,6 +103,7 @@ class Communication::Website::Page < ApplicationRecord ...@@ -103,6 +103,7 @@ class Communication::Website::Page < ApplicationRecord
end end
def references def references
[parent] +
menu_items menu_items
end end
......
...@@ -28,6 +28,12 @@ module Communication::Website::WithSpecialPages ...@@ -28,6 +28,12 @@ module Communication::Website::WithSpecialPages
def translate_special_page(type, language) def translate_special_page(type, language)
# Not found for given language, we create it from the page in default_language # Not found for given language, we create it from the page in default_language
original_special_page = pages.where(type: type.to_s, language_id: default_language_id).first original_special_page = pages.where(type: type.to_s, language_id: default_language_id).first
original_special_page.translate!(language) if original_special_page.present? return unless original_special_page.present?
translated_special_page = original_special_page.translate!(language)
# When we translate a new post, it will generate the permalink by looking for the posts special page
# It will try to find it, or translate it if not found
# At this moment, we need to sync the page with git (in case it's already published)
translated_special_page.sync_with_git
translated_special_page
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment