"Beitrag vollständig anzeigen"-Button funktioniert nicht bei Installationen in Unterordnern

discourse(prod)> # Ersetzen Sie dies durch die Topic-ID oder URL, die Sie debuggen
discourse(prod)> topic_id = 386983
discourse(prod)>
discourse(prod)> # 1. Prüfen, ob TopicEmbed existiert und seinen Inhalt
discourse(prod)> te = TopicEmbed.find_by(topic_id: topic_id)
discourse(prod)> puts "TopicEmbed exists: #{te.present?}"
discourse(prod)> puts "Embed URL: #{te&.embed_url}"
discourse(prod)> puts "Content cache present: #{te&.embed_content_cache.present?}"
discourse(prod)> puts "Content cache length: #{te&.embed_content_cache&.length || 0}"
discourse(prod)> puts "Content SHA1: #{te&.content_sha1}"
discourse(prod)>
discourse(prod)> # 2. Den tatsächlichen zwischengespeicherten Inhalt prüfen (erste 500 Zeichen)
discourse(prod)> puts "\n— Cached content preview —"
discourse(prod)> puts te&.embed_content_cache&.truncate(500)
discourse(prod)>
discourse(prod)> # 3. Versuch, von der Remote-URL abzurufen
discourse(prod)* if te&.embed_url.present?
discourse(prod)*   puts "\n— Attempting remote fetch —"
discourse(prod)*   begin
discourse(prod)*     response = TopicEmbed.find_remote(te.embed_url)
discourse(prod)*     puts "Remote fetch success: #{response.present?}"
discourse(prod)*     puts "Remote body present: #{response&.body.present?}"
discourse(prod)*     puts "Remote body length: #{response&.body&.length || 0}"
discourse(prod)*     puts "Remote title: #{response&.title}"
discourse(prod)*     puts "Remote body: #{response&.body&.truncate(500)}"
discourse(prod)*   rescue => e
discourse(prod)*     puts "Remote fetch FAILED: #{e.message}"
discourse(prod)*   end
discourse(prod)* end
discourse(prod)>
discourse(prod)> # 4. Prüfen, was expanded_for zurückgeben würde
discourse(prod)* if te.present?
discourse(prod)*   puts "\n— Testing expanded_for —"
discourse(prod)*   post = Post.find(te.post_id)
discourse(prod)*
discourse(prod)*   # Cache löschen, um einen neuen Abruf zu erzwingen
discourse(prod)*   Discourse.cache.delete("embed-topic:#{topic_id}")
discourse(prod)*
discourse(prod)*   begin
discourse(prod)*     expanded = TopicEmbed.expanded_for(post)
discourse(prod)*     puts "Expanded content present: #{expanded.present?}"
discourse(prod)*     puts "Expanded content length: #{expanded&.length || 0}"
discourse(prod)*   rescue => e
discourse(prod)*     puts "expanded_for FAILED: #{e.message}"
discourse(prod)*   end
discourse(prod)* end
discourse(prod)>
discourse(prod)> # 5. Relevante Einstellungen prüfen
discourse(prod)> puts "\n— Site Settings —"
discourse(prod)> puts "embed_truncate: #{SiteSetting.embed_truncate}"
discourse(prod)> puts "allowed_embed_selectors: #{SiteSetting.allowed_embed_selectors}"
discourse(prod)> puts "blocked_embed_selectors: #{SiteSetting.blocked_embed_selectors}"
TopicEmbed exists: false
Embed URL:
Content cache present: false
Content cache length: 0
Content SHA1:

— Cached content preview —

— Site Settings —
embed_truncate: true
allowed_embed_selectors:
blocked_embed_selectors:
=> nil
discourse(prod)>

:thinking:

1 „Gefällt mir“