friendsofsymfony / foscommentbundle Goto Github PK
View Code? Open in Web Editor NEWThreaded comments for Symfony
Home Page: http://friendsofsymfony.github.com/
License: MIT License
Threaded comments for Symfony
Home Page: http://friendsofsymfony.github.com/
License: MIT License
When a user is anonymous, a token is returned rather than an exception being thrown (changed some time recently).
The checks need to be modified.
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.
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;
/**
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...
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)
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.
When I click "Vote up" I have this error.
Any idea?
Thanks
Sam
Needed, otherwise a flush() run on the same EM as the CommentBundle is configured could cause a write before we're ready for it.
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 :)
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.
We should use the same methods of getting the entity manager that UserBundle is using.
I install this bundle with minimal conguration withour integrating with fosUser yet but i have a problem with a form. No Error is shown and it doesn add a comment either here is the link to implementation. http://sgnx.lh.pl/web/app_dev.php/pl/1/restauracje/piano-rouge
Any help ?
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
After installing FOSCommentBundle I see that the comment.body column is a varchar(255). I think this should be (text), as 255 characters is short for a reply.
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
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?
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.
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.
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
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
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?
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:
Is there something I'm doing wrong?
Many thanks, keep up the great work :-)
Rémi
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?
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?
Maybe just a documentable issue, rather than needing new features, but since render has performance considerations, it would be worth letting people know of the alternative method.
There is no FOS\CommentBundle\SpamDetection\CommentSpamListener class.
This occurs on line 71 in VoteController.php listAction();
Is there any plan to seperate the vote system out of FOSCommentBundle into FOSVoteBundle?
Instead of having to subclass the Acl classes, the configuration class should have an array:
$perms['ROLE_SUPER_ADMIN'][] = 'iddqd';
$perms['ROLE_USER'][] = 'view';
$perms['ROLE_USER'][] = 'create';
// ...
Hello,
Is it possible to allow people vote only if they haven't vote?
How can I do?
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
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 ?
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
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.
Hello,
I have followed your help doc, but when I like 'button' there is no action...
Any help please.
Thanks
Sam
Due to symfony/symfony@789d5ad changes, object can not passed anyway.
I'm getting such an eror during render:
Fatal error: Call to undefined method FOS\CommentBundle\Entity\ThreadManager::addThread() in /home/platne/sgnx/public_html/vendor/bundles/FOS/CommentBundle/Controller/ThreadController.php on line 41
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:
I suspect it would be a good idea to support both in a FOS bundle.
@stof: Is there much involved to convert to the approach used in UserBundle?
If a thread is closed, and the listener throws an exception, there is no visual feedback of an error.
This could occur in any circumstances where an error is generated (including voting).
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)
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?
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.
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.
Some people have requested the ability to paginate the comment thread. Need to test if it is a viable thing to provide or not.
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.
Well guys i have a strange behavior of CommentBundle settings defined through config.yml:
Here some example:
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
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
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
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 ?
I need mutlilanguage twig templates in my application, so I changed the original ones and added a german and an english message catalogues.
I think this will be useful for many users.
You can download the files here:
http://etzelstorfer.com/2011/07/translation-files-for-foscommentbundle/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.