fsbraun / djangocms-blog

django CMS blog application - Support for multilingual posts, placeholders, social network meta tags and configurable apphooks
https://djangocms-blog.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Sitemap is broken #6

Open MacLake opened 1 month ago

MacLake commented 1 month ago

Description

The creation of a sitemap for blog posts is aborted with an error.

Steps to reproduce

Add BlogSitemap to your sitemaps:

sitemaps: dict = {
    'cmspages': ExtendedSitemap,
    'blog': BlogSitemap,
    # …
}

Versions

Python 3.11, Django 5.1.2, django CMS 4.1.3, djangocms-blog commit 4efe3ba11ca9f6ff8943a8482359a9e2b2a17288

Additional information

I’ve taken a look into the code. The problem is that Post used to be a TranslatableModel (django-parler), but isn’t anymore, so that posts = Post.objects.translated(lang).language(lang).published() doesn’t work anymore. Replacing that line with posts = Post.objects.filter(publish=True) works, but there’s no language selection in it, and then the next error happens just some lines later with smart_override which is also a django-parler function.

I wanted to fix this issue, but I think I’m lacking the insight of the data model and the replacement of django-parler TranslatableModel for Post.

fsbraun commented 1 week ago

fixed by https://github.com/fsbraun/djangocms-blog/commit/3ab96c4ab0d81555a69df58da6aea761d3ef1ad9