nephila / 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
392 stars 192 forks source link

Save does'nt work in detail view when BLOG_USE_PLACEHOLDER = False #685

Open pupattan opened 2 years ago

pupattan commented 2 years ago

if I save a existend blog post in the detail view of the post, the change will not be saved to the database.

{% if post.app_config.use_placeholder %}
    <div class="blog-content">{% render_placeholder post.content %}</div>
{% else %}
    <div class="blog-content">{% render_model post "post_text" "post_text" "" "safe" %}</div>
{% endif %}

config: BLOG_USE_PLACEHOLDER = False

I dont have any PARLER_LANGUAGES settings Similar issue https://github.com/nephila/djangocms-blog/issues/123

pupattan commented 2 years ago

When i debug i found that in placeholderpadmin.py in def edit_field() the form goes invalid expecting for posttitle looks like

 if not cancel_clicked and request.method == 'POST':
            form = form_class(instance=obj, data=request.POST)
            if form.is_valid():
                form.save()
                saved_successfully = True

form.errors in the above code prints the following. But i am editing the post_text only <ul class="errorlist"><li>title<ul class="errorlist"><li>This field is required.</li></ul></li></ul>

pupattan commented 2 years ago

Anything to change in PostAdminForm ?