Comments not saving

Create issue
Issue #10 resolved
L3TH4L1TY created an issue

Installed the plugin, attached the component to the blog post page, replacing the comments tag included in Vanilla theme. I set "plugin" to Rainlab.Blog under the component options, and have also tried "none", and get the following error. Nothing in database

Screenshot_1.png

Comments (24)

  1. Alexey Sozonov repo owner
    • changed status to open

    Hello!

    Can you update your post.htm file:

    #!html
    
    title = "Blog Post"
    url = "/blog/post/:slug"
    layout = "default"
    description = "Viewing a single blog post"
    is_hidden = 0
    
    [blogPost]
    slug = "{{ :slug }}"
    categoryPage = "blog/category"
    
    [forumEmbedTopic]
    embedCode = "{{ :slug }}"
    channelSlug = "channel-orange"
    memberPage = 404
    
    [comments]
    plugin = "none"
    mode = 1
    depth = 0
    pageNumber = "{{ :page }}"
    commentsPerPage = 10
    rate = "none"
    duration = 400
    ==
    <?php
    function onEnd()
    {
        $this->page->title = $this->post->title;
    }
    ?>
    ==
    {% component 'blogPost' %}
    
    <hr />
    <h4>Comments</h4>
    {% component 'comments' %}
    
    and try again?!

  2. L3TH4L1TY reporter

    Hiya, done that, although they look to be the defaults as for the exception of the forumEmbedTopic (which I'd just removed) everything else was the same. The error was still the same, however I then saw there were a few updates which I ran, including the Auth fix, and although I don't get the same error dialog, there's still no comments being saved despite the success message.

  3. Alexey Sozonov repo owner

    I need more info. Did you install/modify anything else?

    Can you give me demo access?

  4. L3TH4L1TY reporter

    Hiya, I've managed to fix it after a bit more digging, this is the sql error that was being created:

    #!php
    
    SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'parent_id' at row 1 (SQL: insert into `xeor_comments_comments` (`uri`, `type`, `parent_id`, `content`, `user_id`, `hostname`, `name`, `mail`, `homepage`, `published`, `thread`, `content_html`, `nest_left`, `nest_right`, `updated_at`, `created_at`) values (blog/post/test-blog, none, , test, 1, 92.10.222.255, , , , 0, 01/, <p>test</p>, 1, 2, 2017-04-05 19:01:08, 2017-04-05 19:01:08))
    

    Turns out my MySQL server had strict mode on, which doesn't like nothing being sent for null values

  5. petrudumitru

    Good morning, i have exactly the same issue, comments are not saving. I don't get any error just a large timeout, if you check back on backend the comment it is visibile, but does not in frontend.

    The blue loading bar never finish loading ...

    Can you fix that please? Need more info?

  6. petrudumitru

    Good morning,

    Apologize for the delay, i was trying to fixed it myself, this is the wired error, no code error works but windows get frozen like you can see on the picture. comments_issue.jpg

  7. petrudumitru

    Check the blue loading bar ... loop never end, its work before if you refresh the page, but it's a bug, users will leave the site.

  8. Alexey Sozonov repo owner

    You have some js errors... Please fix the next error Uncaught TypeError: $(...).foundation is not a function

  9. Alexey Sozonov repo owner

    Also you should change this data-request-success="afterSubmit($el, context, data, textStatus, jqXHR)" to something like this data-request-success="customFunction()", because the function afterSubmit() is undefined.

    Or you can copy xeor.comments.js to /thems/YOURTHEME/partials/comments/assets/js/xeor.comments.js and modify js file as you wish.

  10. Alexey Sozonov repo owner

    I think that you have old/modified version of components/comments/default.htm

    You have:

    <form id="comment-form" class="comment-form" data-request="onComment" data-request-update="'comments::new': '@#comments'" data-request-success="afterSubmit($el, context, data, textStatus, jqXHR)" data-options="" role="form">
    

    Should be:

    <form id="comment-form"
                  class="comment-form"
                  data-request="onComment"
                  data-request-update="'{{ __SELF__ }}::comment': '@#loader'"
                  role="form">
    

  11. petrudumitru

    I'm using a overrided partial from your old version, that is the problem, you can close the thread for now, thank you very much :)

  12. Log in to comment