Closed Chrysweel closed 12 years ago
Do you see errors in your javascript console?
What do you see on the url: /xxx/web/app_dev.php/api/threads/e.id/comments
asm89 thanks by to reply.
In mi web console I see a call strange: URL of one request: http://localhost/xxx/web/app_dev.php/threads104/comments?permalink=http%253A%252F%252Flocalhost%252Fxxx%252Fweb%252Fapp_dev.php%252page
And on the url: /xxx/web/app_dev.php/api/threads/104/comments " [Semantical Error] line 0, col 101 near 'ancestors AS': Error: Class Application\ApplicationBundle\Entity\Comment has no field or association named ancestors. "
I seen that when I entry on page which include 'FOSCommentBundle:Thread:async.html.twig' is created in my database one thread.
My class comment extends of FOS\CommentBundle\Entity\Comment.
I don't know that is wrong. Any idea?
Help me please!! Any idea?
Can you please post your entire configuration including entities, config.yml, the controller you're trying to include it in.
Ok merk.
{% extends 'ApplicationBundle::layout.html.twig' %} {% block center %} {% include 'FOSCommentBundle:Thread:async.html.twig' with{'id': e.id} %} {% endblock %}
(...) {% block javascripts %} < script type="text/javascript" src="{{ asset('js/jquery-1.7.1.min.js')}}"> < script type="text/javascript" src="{{ asset('js/jquery.color-RGBa-patch.js')}}"> < script type="text/javascript" src="{{ asset('js/example.js')}}"> {% endblock %}
imports:
- { resource: parameters.ini }
- { resource: security.yml }
- { resource: services.yml }
parameters:
security.acl.permission.map.class: Sonata\AdminBundle\Security\Acl\Permission\AdminPermissionMap
sonata.admin.security.mask.builder.class: Sonata\AdminBundle\Security\Acl\Permission\MaskBuilder
framework:
translator: {fallback: es}
secret: %secret%
charset: UTF-8
router: { resource: "%kernel.root_dir%/config/routing.yml" }
form: true
csrf_protection: true
validation: { enable_annotations: true }
templating: { engines: ['twig', 'php'] } #assets_version: SomeVersionScheme
session:
default_locale: %locale%
auto_start: true
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
assetic:
debug: %kernel.debug%
use_controller: false
filters:
cssrewrite: ~
yui_css:
jar: usr/share/yui-compressor/yui-compressor.jar
yui_js:
jar: usr/share/yui-compressor/yui-compressor.jar
doctrine:
dbal:
default_connection: default
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8
orm:
auto_generate_proxy_classes: %kernel.debug%
#auto_mapping: true
entity_managers:
default:
mappings:
ApplicationSonataMediaBundle: ~
FOSUserBundle: ~
SonataUserBundle: ~
ApplicationBundle: ~
LocalBundle: ~
SonataMediaBundle: ~
swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
jms_security_extra:
secure_controllers: true
secure_all_services: false
jms_serializer:
handlers:
object_based: false
datetime:
format: < ISO8601 (Y-m-dTH:i:s)>
default_timezone: none
array_collection: true
form_error: true
constraint_violation: true
property_naming:
separator: _
lower_case: true
metadata:
cache: file
debug: %kernel.debug%
file_cache:
dir: %kernel.cache_dir%/serializer
directories:
any-name:
namespace_prefix: Application\ApplicationBundle
path: @ApplicationBundle/Resources/config/serializer
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: Application\ApplicationBundle\Entity\User
group:
group_class: Application\ApplicationBundle\Entity\Group
fos_comment:
db_driver: orm class: model: comment: Application\ApplicationBundle\Entity\Comment thread: Application\ApplicationBundle\Entity\Thread
<?php
namespace Application\ApplicationBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use FOS\CommentBundle\Entity\Comment as BaseComment;
/**
@ORM\ChangeTrackingPolicy("DEFERREDEXPLICIT") / class Comment extends BaseComment { /_*
/**
/**
/**
You dont have auto mapping enabled, and do not import FOSCommentBundle mappings.
I have modified my config.yml (...) doctrine: orm:
auto_mapping: true
# entity_managers:
# default:
# mappings:
# ApplicationSonataMediaBundle: ~
# FOSUserBundle: ~
# SonataUserBundle: ~
# ApplicationBundle: ~
# LocalBundle: ~
# SonataMediaBundle: ~
(...) But don't work.
Reopen the issue please!
Cleared your cache?
What error is reported now?
Yes I cleared my cache with: sudo rm -r app/cache/dev The same, the comment don't see so I cant write comment in my post.
And in my console web, I see the following error: URL of the request: http://localhost/application/web/app_dev.php/api/threads/102/comments?permalink=http%253A%252F%252Flocalhost%252Fapplication%252Fweb%252Fapp_dev.php%252Fpost%252Ftitle-post
Méthod of request:
GET
status of code:
HTTP/1.0 500 Internal Server Error
Any idea?? I had installed the FOSCommentBundle which work it correctly a month ago,And now that I reinstalled the FOSCommentBundle with the FOSRestBUndle and the JMSSecurity... and I have this problem. Help me please!
I need more information than a 500 Internal Server Error
to see what your problem is.
You have to update your schema when changing mapping settings.
asm89 I don´t have more information!
Finally it works !!!! THANKS merk, I update schema with: sudo php app/console doctrine:schema:update --force and now I see the comments.
But something really strange is happening, when I see a post, I don´t see the comments but if I do CTRL+F5 then it works.I see other post and the comments not are, but I do CTRL+F5 then I see the comments.
Why does this happen?
THANK YOU SO MUCH!!!
Ok I have solved it also. This problem ocurred because the call to comment.js was before of the call to jquery-1.7.1.min.js.
I hope help other people with this problem.
thank you very much!! Merk and asm89 thanks! ; )
Glad you worked it out. I'll close the issue now.
hey @merk is it necessary to include default comment.js in layout ,as i already have in web/foscumment/js my console showing
http://localhost/symfony/MySymPro/web/app_dev.php/api/threads/foo/comments?permalink=http%253A%252F%252Flocalhost%252Fsymfony%252FMySymPro%252Fweb%252Fapp_dev.php%252Fprofile%252F 500 ..some jquey error
I did all steps, but I can't see the script of comments. But in my source code of page is the code of script.
The number 104 is a integer.( the id of my post) I included jquery-1.7.1.min.js
What am I doing wrong? Any idea? Thanks.