rieko
Février 9, 2021, 6:35
1
J’ai supprimé par erreur les pages FAQ, politique de confidentialité et CGU depuis la console (rails c).
Je souhaiterais maintenant recréer ces pages.
Comment puis-je régler ce problème ?
Je ne parviens pas à voir ces pages car le cercle de chargement tourne indéfiniment…
Merci de votre aide.
Bonjour !
C’est dommage, j’espère que le message suivant vous aidera :
Interesting. How did you manage to delete those topics? You shouldn’t be allowed to delete them in the UI.
First, let’s see if the topics are really gone.
./launcher enter app
rails c
Topic.with_deleted.exists?(SiteSetting.guidelines_topic_id)
Topic.with_deleted.exists?(SiteSetting.tos_topic_id)
If the topics are really gone, create two new topics in the Staff category and assign the topic ids in the rails console to the site settings.
SiteSetting.guidelines_topic_id = 4711 # replace with t…
rieko
Février 10, 2021, 1:43
3
@Thomas_G Bonjour ! Merci pour votre aide.
J’ai vérifié l’existence des pages.
Topic.with_deleted.exists?(SiteSetting.guidelines_topic_id)
Topic.with_deleted.exists?(SiteSetting.tos_topic_id)
Topic.with_deleted.exists?(SiteSetting.privacy_topic_id)
Les résultats sont tous vrais, alors j’ai essayé de les récupérer.
faq = Topic.with_deleted.find(SiteSetting.guidelines_topic_id)
tos = Topic.with_deleted.find(SiteSetting.tos_topic_id)
pp = Topic.with_deleted.find(SiteSetting.privacy_topic_id)
faq.recover!
tos.recover!
pp.recover!
La récupération a réussi dans le terminal, mais les pages /faq, /toc et /privacy affichaient une erreur.
Ensuite, j’ai vérifié les topic_id de ces sujets depuis le terminal et j’ai défini les URL sur /admin/site_settings/category/legal.
Maintenant, les pages fonctionnent correctement. Merci !