From 8a89e33e7cb7c8779ce0a535ab2f591c7e1b34ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Fri, 22 Oct 2021 11:20:32 +0200
Subject: [PATCH] fix post title

---
 app/models/communication/website/imported/post.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/models/communication/website/imported/post.rb b/app/models/communication/website/imported/post.rb
index ab669d4d1..07d13e921 100644
--- a/app/models/communication/website/imported/post.rb
+++ b/app/models/communication/website/imported/post.rb
@@ -81,9 +81,9 @@ class Communication::Website::Imported::Post < ApplicationRecord
       # Don't touch if there are no remote changes (this would do useless server workload)
       # return if post.updated_at == updated_at
     end
-    title = Wordpress.clean title.to_s
     puts "Update post #{post.id}"
-    post.title = title unless title.blank? # If there is no title, leave it with "Untitled"
+    sanitized_title = Wordpress.clean self.title.to_s
+    post.title = sanitized_title unless sanitized_title.blank? # If there is no title, leave it with "Untitled"
     post.slug = slug
     post.description = ActionView::Base.full_sanitizer.sanitize excerpt.to_s
     post.text = Wordpress.clean content.to_s
-- 
GitLab