Giter VIP home page Giter VIP logo

sulucommentbundle's Introduction

SuluCommentBundle

Official Sulu Bundle Badge

GitHub license Test workflow status Sulu compatibility

The SuluCommentBundle adds support for adding comments to different types of entities (pages, articles, custom) in Sulu.

Included features:

  • Website renderer
  • Sulu-Admin integration to delete and update comments

Status

This repository will become version 1.0 of SuluCommentBundle. It is under heavy development and currently its APIs and code are not stable yet (pre 1.0).

Requirements

  • Composer
  • PHP ^7.2
  • Sulu ^2.0

For detailed requirements see composer.json.

Documentation

The the Documentation is stored in the Resources/doc/ folder.

Installation

All the installation instructions are located in the Documentation.

License

This bundle is under the MIT license. See the complete license in the bundle

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.

When reporting a bug, it may be a good idea to reproduce it in a basic project built using the sulu/skeleton to allow developers of the bundle to reproduce the issue by simply cloning it and following some steps.

sulucommentbundle's People

Contributors

alexander-schranz avatar chirimoya avatar luca-rath avatar mamazu avatar martinlagler avatar niklasnatter avatar prokyonn avatar reyostallenberg avatar stephenbeirlaen avatar wachterjohannes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sulucommentbundle's Issues

Edit or delete comment even if the user is not the creator

Q A
Bug? yes
New Feature? no
Sulu Version 2.5.13
Sulu Comment Bundle Version 2.0.0
Browser Version Google Chrome Version 123.0.6312.86 (Official Build) (64-bit)

Actual Behavior

It is possible to manipulate or delete existing comments / threads by simply sending post requests to the WebsiteController:
e.g. https://localhost:8000/threads/b69cc46e-9527-48b5-a98d-3a3634c41f05/comments/2

Neither the WebsiteController nor the CommentManager validates the current user with the creator of the comment.

Expected Behavior

Only the creator of the comment should be able to delete or edit the comment.

Steps to Reproduce

  1. Create a comment on the website frontend
  2. Send post or delete request with threadId and commentId (you can find them in the html code on the frontend)

Add tab comments to threads

Q A
Bug? no
New Feature? yes
Sulu Version none

Expected Behavior

In the thread-form there should be a tab with a list of related comments. From there you should be able to goto the comment-form and back.

Tests should also be runnned with prefer-lowest

Q A
Bug? no
New Feature? no
Sulu Version <1.5
Browser Version all

Actual Behavior

The tests should run with --prefer-lowest. The problem is that sulu 1.3 is not able to run the tests with lowest.

Thread title is always empty

Q A
Bug? Yes
New Feature? no
Comment Bundle Version 2.0.0
Browser Version Chrome Version 124.0.6367.118 (Official Build) (64-bit)

Actual Behavior

After creating a comment, the thread title is empty

Expected Behavior

Thread title should be filled in with what's passed as a template variable as described in the official docs

Steps to Reproduce

  1. Include the comment section in your page template (see docs):
{{ render(path('sulu_comment.get_threads_comments', {
    threadId: 'page-' ~ uuid, 
    referrer: app.request.uri,
    threadTitle: 'This is my thread title', 
    _format: 'html'
})) }}
  1. Fill in a comment
  2. Send comment
  3. Thread title in admin area is empty

PHP 8 support

Q A
Bug? no
New Feature? yes
Sulu Version 2.x
Browser Version Browser name and version

Actual Behavior

Should work with latest Sulu bundle and PHP 8

Is there already work being done to make this work with PHP 8 and latest Sulu 2.5?

Form validation errors result in 400 Response

Q A
Bug? yes
New Feature? no
Sulu Version Bundle 2.0.0; Sulu 2.5.10

Actual Behavior

When Comment-form validation fails a 400-http-Response is sent back.

Expected Behavior

Comments form with validation errors is shown.

Steps to Reproduce

Extend Comment entity and CommentForm type and add a property with some constraint (eg. NotBlank).
On submission of empty form the validation fails and a "Bad Request" Response (400) is sent back to the client.

Possible Solutions

Change form-action to referrer and let the form handle the request there?

ThreadTitle is always empty

Q A
Bug? yes
New Feature? no
Sulu Version Bundle 2.0.0; Sulu 2.5.10

Actual Behavior

Threads are created without a title.

Expected Behavior

Threads get the title of the page/article they belong to.

Steps to Reproduce

Add comments form to article detail view and submit a comment -> a thread w/o a title is created.

Possible Solutions

Pass the Request-Param $threadTitle = $request->get('threadTitle') as an option to the comments-form when creating it inside \Sulu\Bundle\CommentBundle\Controller\WebsiteCommentController::cgetCommentsAction.
The rest can then be handled by extending the form-type and adding the intended title to the twig-render-call inside the article template.

Enable CSRF Protection

Q A
Bug? no
New Feature? no
Sulu Version > 1.0.0
Browser Version ---

Actual Behavior

CommentType disable csrf protection by default.

Expected Behavior

CSRF Protection should be enabled by default. But this will change the behaviour of AJAX requests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.