Closed hamzarebaichkaw closed 7 years ago
"exception" => Twig_Error_Runtime {#1601 ▼ -lineno: 3 -name: "StarRatingBundle:Display:ratingDisplay.html.twig" -rawMessage: "An exception has been thrown during the rendering of a template ("Notice: Object of class Symfony\Component\Form\FormView could not be converted to int")." -sourcePath: "/var/www/html/MMSS/vendor/blackknight467/star-rating-bundle/blackknight467/StarRatingBundle/Resources/views/Display/ratingDisplay.html.twig" -sourceCode: """
""" #message: "An exception has been thrown during the rendering of a template ("Notice: Object of class Symfony\Component\Form\FormView could not be converted to int")." #code: 0 #file: "/var/www/html/MMSS/vendor/blackknight467/star-rating-bundle/blackknight467/StarRatingBundle/Resources/views/Display/ratingDisplay.html.twig" #line: 3@hamzarebaichkaw can you post the twig you're using and the value of the variable you're passing to the rating filter?
{{ form_start(commentaire, {'action': path('AjoutCommentaire') , 'method': 'POST','class':'comment-form'}) }}
{{ form_end(commentaire) }}
@hamzarebaichkaw is "commentaire.rating" a string or an int?
int
@hamzarebaichkaw oh, you're trying to use a filter in your form. Just remove the rating filter and you should be fine.
{{ form_widget(commentaire.rating) }}
@blackknight467 thank you it worked
An exception has been thrown during the rendering of a template ("Notice: Object of class Symfony\Component\Form\FormView could not be converted to int")