Issue with forking {% component 'comments' %}

Create issue
Issue #37 new
Paolo M created an issue

In blog post page, with {% component 'comments' %} it works fine.

the problems come forking in:

{% set comments = comments.comments %} {% set userId = comments.userId %} {% set depth = comments.depth %} ...

Comments (9)

  1. Alexey Sozonov repo owner

    Hello! Can you provide more info? I don't understand what does it mean "forking {% component 'comments' %}"

  2. Paolo M reporter

    Hi Alexey, this is what I mean when I say "forking":

    on the CMS > pages > mypage.htm I drag Comments component, the result is:

    {% component 'comments' %}
    

    Then in right upper corner I click on the button code-fork-icon-64988.png, the result is:

    {% set comments = comments.comments %}
    {% set userId = comments.userId %}
    {% set depth = comments.depth %}
    {% set rate = comments.options.rate %}
    
    <div class="container">
        <h3>Comments</h3>
        <div id="message-wrapper" class="alert alert-info alert-dismissible fade in" role="alert" style="display: none;">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span>
            </button>
            <span class="message created success" style="display: none">Your comment has been posted!</span>
            <span class="message updated success" style="display: none">Your comment has been updated!</span>
        </div>
    
        <div id="comments"
        {% for key, value in comments.options %}
            data-{{ key }}="{{ value }}"
        {% endfor %}>
    
            {% partial comments ~ "::comments" comment=comment userId=userId depth=depth rate=rate %}
    
        </div>
    
        ...
    
        <div id="loader" style="display: none"></div>
    </div>
    
  3. Alexey Sozonov repo owner

    Hello! Sorry for the late reply. I checked it. You can remove this line.

    {% set comments = comments.comments %}
    

    And everything should works fine.

  4. Paolo M reporter

    Hi Alexey, this does not seem to work for me. what I did was change the name of the component and the LengthAwarePaginator. It seemed to me a conflict due to the equal name of the plugin and the component. And now it works fine. Perhaps the problem is, as in the first dump() attached image: {{ component }} NULL, {{ userId }} NULL, {{ rate }} NULL, Unfortunately I'm not an experienced developer and I can't explain well in English

  5. Paolo M reporter

    With a new october installation the solution:

    Remove this line

    {% set comments = comments.comments %}
    

    works fine

  6. Log in to comment