Code Monkey home page Code Monkey logo

foscommentbundle's People

Contributors

aetherfox avatar andreiciceu avatar antoinemineau avatar apierr avatar asm89 avatar blankse avatar erkhembayar-gantulga avatar fran6co avatar franmomu avatar guilhemn avatar helios-ag avatar helmer avatar inssein avatar jdreesen avatar jspizziri avatar marcari avatar mazen avatar merk avatar miliooo avatar mweimerskirch avatar n1c01a5 avatar ornicar avatar problematic avatar shibby avatar snebes avatar stof avatar tarjei avatar umpirsky avatar vslinko avatar xwb avatar

Stargazers

 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  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  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  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

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foscommentbundle's Issues

Threads should be able to be closed

There is already a property to handle this, but the Twig extension used to check if the user can comment doesnt take this into account, and the other services should also throw exceptions in this circumstance.

Unable to generate thread Entity with Doctrine ORM

Hi

I tried to generate the thread entity which I emplemented like this:

use Doctrine\ORM\Mapping as ORM;
use FOS\CommentBundle\Entity\Thread as BaseThread;

/**

  • @Orm\Entity
  • @Orm\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
    /
    class Thread extends BaseThread
    {
    /
    *
    • @Orm\Id
    • @Orm\Column(type="integer")
    • @Orm\GeneratedValue(strategy="AUTO")
      */
      protected $id;

but when I run the command php app/console doctrine:schema:update --force i get the error:

[Doctrine\ORM\Mapping\MappingException]
Duplicate definition of column 'id' on entity 'Fld\CommentBundle\Entity\Thread' in a field or discriminator column mapping.

This is probably related to #24 which seems to have solved the problem a first time but #56 IMO has reintroduced the problem in the the Model/Thread.php file.

I hope it can helps...

Allow to override Thread class

Looks like Thread class cannot be overridden via Bundle configuration, although that would be useful (simplest example - add title to thread for convenient reference by admins)

Moderation Queue

It would be nice to be able to push comments to a moderation queue.

I suspect it would work that if the user lacks a specific ROLE (for role based security) or is missing a specific Acl entry, the comment should be moderated.

Vote - Error: cannot instantiate abstract class Vote

When I click "Vote up" I have this error.


Fatal error: Cannot instantiate abstract class FOS\CommentBundle\Entity\Vote in //vendor/bundles/FOS/CommentBundle/Model/VoteManager.php on line 35

Any idea?

Thanks
Sam

Explicit flush for entities

Needed, otherwise a flush() run on the same EM as the CommentBundle is configured could cause a write before we're ready for it.

FOSCommentBundle + Pager

Hi there!

I tried to use your bundle - its kind of voodoo magic for the beginers in Symfony2

My cliend want to use threaded comments with pager - is it possible to use pager with FOSCommentBundle?

I ask it because I would like to get some advice before spending a couple days while trying to integrate FOSCommentBundle into my application :)

Column names in ORM

How about changing column names from camelCase to underscore-delimited (as can be seen ie in FOSUserBundle)? As the schema gets generated in lowercase (at least for my configuration), reading stuff like lastcommentat can be a pain, last_comment_at would be much better imo :)

Plus it would be consistent with other FOS stuff, what do you think? If approved, I can work on it.

No field or association named ancestors

I get this error:

An exception has been thrown during the rendering of a template ("[Semantical Error] line 0, col 106 near 'ancestors AS': Error: Class Website\SharedBundle\Entity\Comment has no field or association named ancestors") in FOSCommentBundle:Thread:show.html.twig at line 27.

Using Doctrine & FOSUserBundle

Voting + authentication issue

What happens: When you login after voting on a comment, the login redirect sends you back to the vote route that was called via AJAX.

Steps to recreate:

I'm using FOSUserBundle with default settings in security.yml

  1. Be anonymous
  2. Vote on a comment
  3. Go log in
  4. Be redirected back to /vote/{id}/{direction}

And that's it. I assume it's happening because the vote action was the last one that Symfony hit before the login attempt, so that's what it has stored as the "last request". Is there anything we can do to fix this?

[1.0] Update documentation

Documentation will need to be updated with details on the EventDispatcher, changes to the Controllers for the REST pr, and tidied up a little bit.

I'd like to present the ORM entities as defaults for configuration examples, and mention Mongodb in a separate document with the example documents presented there. It should make it a bit easier to follow.

MongoDB invalid type "text"

InvalidArgumentException: Invalid type specified "text". (uncaught exception) at /srv/storage/php/symfony/projects/mmorpgplus/vendor/doctrine-mongodb-odm/lib/Doctrine/ODM/MongoDB/Mapping/Types/Type.php line 120

This happens when trying to comment.

Fatal error: Allowed memory size

Hello guys,

I encountered problem. I've tried almost for day to fix, all things works ok , except when I add or reply comment,
always returned allowed memory size, But persisting data and all other things works normal

Please tell me, I've done wrong

vendor/symfony/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php on line 34

Gravatar and comment

Hello,

What do think about implement a method that added a image near a specific comment?

it will be really cool to have this functionnality..

Sam

Duplicate ID attributes

Currently, while rendering threaded comments, two duplicate forms exist - one where you can comment and other (hidden prototype) shown when "Reply" button is clicked. This leads to duplicate elements (textarea/csrf) having same ID, which ie leads to possible problems in JavaScript.

Proposed solution: pass two different forms (empty classes extending from current CommentType), which get rendered with different id/name attributes. During clone, change id attribute by appending a numerical suffix (ie comment ID).

What do you think?

Roles : login form

Hi,

Since I don't know where to look for help on this (really sweet) bundle, I'm creating an Issue, I hope you won't mind.

I'm trying to implement comments on my blog using Roles.

I would like users to be logged in (=ROLE_USER) to create a comment.

In my config, I did the following:

acl_roles:
        comment:
            create: ROLE_USER
            view: IS_AUTHENTICATED_ANONYMOUSLY
            edit: ROLE_ADMIN
            delete: ROLE_ADMIN
        thread:
            create: ROLE_USER
            view: IS_AUTHENTICATED_ANONYMOUSLY
            edit: ROLE_ADMIN
            delete: ROLE_ADMIN

If I'm logged in, everything works perfectly.

However, if I'm anonymous, here's what happens:

  • Comment form is visible : I write my message
  • I submit my message
  • My form login appears in place of my thread (btw duplicating my layout -> that maybe my own fault)
  • I log in
  • I fall on the following exception : No route found for "GET /new/3": Method Not Allowed (Allow: POST)

Is there something I'm doing wrong?

Many thanks, keep up the great work :-)

Rémi

ACL permissions not set for created threads?

I'm using the bundle with security settings enabled, and when a new thread is created, the AclThreadManager#createThread() method simply kicks over to the real manager, and no ACL entries are created, so I'm getting a "permission denied" security exception when I try to view the thread (which is resolved by running fos:comment:fixAces, but this is less than ideal).

Am I using the bundle incorrectly, or is this a gap in the acl functionality? If the latter, I'll go ahead and write some code; if the former, what do I need to be doing differently?

[Bug] Nested comments - undefined index in Tree

CommentManager->organiseComments is inputted with an array of comments, sorted by Ancestors ASC.
Due to this $path->traverse($ancestor) fails, since the tree is built in wrong order.

Proposed solution is to add NULLS FIRST to sorting statement, except, I'm not sure this is really the correct way to fix this.

Also: I am using ORM instead of MongoDB, perhaps this is why you haven't noticed it?

1 vote for 1 person ?

Hello,

Is it possible to allow people vote only if they haven't vote?

How can I do?

How can I retrieve comment information joining with my table?

Hi,

I retrieve all my entities from the Post table where each media has some comments...

I want to retrieve comment with all my Post, how can I do ?

I have tried to do this, but it doesn't work:

         $query = $this->getEntityManager()
                ->createQuery('
        SELECT      P
        FROM        NamespaceMyBundle:Post P
        LEFT JOIN       Comment C ON C.id=CONCAT('post_',P.id)

        GROUP BY    P.id
        ORDER BY    P.dEvent DESC, P.dCreated DESC'
        )

        ;

I have this error:
[Semantical Error] line 0, col 96 near 'Com ON C.id=CONCAT("post_",P.id)
WHERE': Error: Identification Variable Comment used in join path expression but was not defined before.

Any idea?

Thanks

MongoDB implementation missing class alias

I have tried to setup the bundle using mongodb driver, but i get errors about

        if ('mongodb' === $config['db_driver']) {
            if (null === $config['model_manager_name']) {
                $container->setAlias(new Alias('fos_comment.document_manager', false), 'doctrine.odm.mongodb.document_manager');
            } else {
                $container->setAlias(new Alias('fos_comment.document_manager', false), sprintf('doctrine.odm.%s_mongodb.document_manager', $config['model_manager_name']));
            }
        }

Missing class Alias. Any hits ?

Symfony2 + FOSComment - Redirection after new comment

Hi,

I use FOSCommentBundle with Symfony2 and when I save a new comment it redirect me to another page.

I have read the help doc, but I haven't found the help I need.

So my question is how can I do to stay in the same page. What is the class or method I have to reimplement?

Thanks for all

Sam

assets should be in a folder named public, not assets

as of now, app/console assets:install does not pick up FosCommentBundle when scanning for assets because the folder name is wrong.

This causes a series of sideeffects, especially when assetic is used since it has issues processing @BundleName based assets currently.

It's an easy change which can be done quickly, though I'd ask first before i submit a pull request.

Vote doesn't work

Hello,

I have followed your help doc, but when I like 'button' there is no action...

Any help please.

Thanks
Sam

Comment flagging

It would be nice to be able to flag comments as inappropriate for example. A user would be able to flag a comment and provide an optional reason for the flagging. Apart from that, there should also be an overview of all the flagged comments. This could work like the moderation queue #90.

This feature would require:

  • Code similar to the voting
  • A new role for the flagging
  • Code for the "flag queue"
  • A new role for the viewing of the overview of flagged comments

Custom views & Routes

I'm not sure if this is already supported, but I need the ability to use my own custom template or at least override the controller.

I see a lot of important PR's.. Can't wait to get those up because I noticed that the current ACL implementation is somewhat buggy. (ie. users can see comment form when not logged in, etc, etc)

Notice: Undefined index: url in FOSCommentExtension.php

I'm getting undefined index notices for the spam detection configuration, but I'm not sure the best way of dealing with it - add default empty values for the configuration? or adjust the extension to make sure the akismet configuration is present?

A couple of issues with documentation

First, thanks for the awesome plugin!

Although the index.rst walks you through adding acl support it doesn't really explain two things.

acl: true

This should be shown in the "Enabling use of the Symfony2 Security Component" section.

Also you should make it clear to new users of acl that they must run this command first.

php app/console init:acl

Experienced Symfony2 developers may know these things but I'm sure it wouldn't hurt to add it to the documentation. It would have saved me a few hours.

More/better error reporting on access issues

If you don't have access to post a comment, the current implementation gives the comment field a red color. The user should get more feedback / options.

It would be extra nice if it would be extensible somehow. To for example add login popup when integrating with FOSUserBundle.

Pagination

Some people have requested the ability to paginate the comment thread. Need to test if it is a viable thing to provide or not.

addThread method is missing?

Fatal error: Call to undefined method FOS\CommentBundle\Entity\ThreadManager::addThread() in /private/var/www/myproject/vendor/bundles/FOS/CommentBundle/Controller/ThreadController.php on line 187

Can't find any mention about addThread except in that controller.

ACL Roles and CommentBundle configuration issue

Well guys i have a strange behavior of CommentBundle settings defined through config.yml:
Here some example:

  1. Works fine:
fos_comment:
    db_driver: orm
    class:
        model:
            comment: FM\UserBundle\Entity\Comment    
    form:
        comment:
            name: fos_comment_comment
            type: fos_comment.comment  
    service:
        acl:
            roles:
              comment:
                 create: IS_AUTHENTICATED_ANONYMOUSLY
                 view: IS_AUTHENTICATED_ANONYMOUSLY
                 edit: ROLE_ADMIN
                 delete: ROLE_ADMIN
              thread:
                 create: IS_AUTHENTICATED_ANONYMOUSLY
                 view: IS_AUTHENTICATED_ANONYMOUSLY
                 edit: ROLE_ADMIN
                 delete: ROLE_ADMIN
              vote:
                  create: IS_AUTHENTICATED_ANONYMOUSLY
                  view: IS_AUTHENTICATED_ANONYMOUSLY
                  edit: ROLE_ADMIN
                  delete: ROLE_ADMIN                 
        manager:
            thread: fos_comment.manager.thread.default
            comment: fos_comment.manager.comment.default
            vote: fos_comment.manager.vote.default
        acl:
            thread: fos_comment.acl.thread.security
            comment: fos_comment.acl.comment.security              
            vote: fos_comment.acl.vote.security
  1. Not work, throw an exception (Unrecognized options "roles" under "fos_comment.service.acl"):
fos_comment:
    db_driver: orm
    class:
        model:
            comment: FM\UserBundle\Entity\Comment    
    form:
        comment:
            name: fos_comment_comment
            type: fos_comment.comment  
    service:           
        manager:
            thread: fos_comment.manager.thread.default
            comment: fos_comment.manager.comment.default
            vote: fos_comment.manager.vote.default
        acl:
            thread: fos_comment.acl.thread.security
            comment: fos_comment.acl.comment.security              
            vote: fos_comment.acl.vote.security
            roles:
              comment:
                 create: IS_AUTHENTICATED_ANONYMOUSLY
                 view: IS_AUTHENTICATED_ANONYMOUSLY
                 edit: ROLE_ADMIN
                 delete: ROLE_ADMIN
              thread:
                 create: IS_AUTHENTICATED_ANONYMOUSLY
                 view: IS_AUTHENTICATED_ANONYMOUSLY
                 edit: ROLE_ADMIN
                 delete: ROLE_ADMIN
              vote:
                  create: IS_AUTHENTICATED_ANONYMOUSLY
                  view: IS_AUTHENTICATED_ANONYMOUSLY
                  edit: ROLE_ADMIN
                  delete: ROLE_ADMIN     
  1. Same behav as second example, but this described in docs(exception Unrecognized options "roles" under "fos_comment.acl"):
fos_comment:
    db_driver: orm
    class:
        model:
            comment: FM\UserBundle\Entity\Comment    
    form:
        comment:
            name: fos_comment_comment
            type: fos_comment.comment  
    service:           
        manager:
            thread: fos_comment.manager.thread.default
            comment: fos_comment.manager.comment.default
            vote: fos_comment.manager.vote.default
        acl:
            thread: fos_comment.acl.thread.security
            comment: fos_comment.acl.comment.security              
            vote: fos_comment.acl.vote.security
    acl:
        roles: # optional configuration for the Role Acl providers.
            comment:
                create: IS_AUTHENTICATED_ANONYMOUSLY
                view: IS_AUTHENTICATED_ANONYMOUSLY
                edit: ROLE_ADMIN
                delete: ROLE_ADMIN
            thread:
                create: IS_AUTHENTICATED_ANONYMOUSLY
                view: IS_AUTHENTICATED_ANONYMOUSLY
                edit: ROLE_ADMIN
                delete: ROLE_ADMIN
            vote:
                create: IS_AUTHENTICATED_ANONYMOUSLY
                view: IS_AUTHENTICATED_ANONYMOUSLY
                edit: ROLE_ADMIN
                delete: ROLE_ADMIN     

Getting an error during schema update

Fatal error: Declaration of Acme\UserBundle\Entity\Comment::setThread() must be compatible with that of FOS\CommentBundle\Model\CommentInterface::setThread() in /home/platne/sgnx/public_html/src/Acme/UserBundle/Entity/Comment.php on line 14

Any clues what could i do wrong ?

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.