Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected argument of type "object, array or empty", "string" given in PropertyPathMapper.php #54

Closed
msalsas opened this issue Jun 20, 2013 · 1 comment

Comments

@msalsas
Copy link

msalsas commented Jun 20, 2013

Hello, I'm newer in symfony, so I'm sorry if my question is obvious. I've installed your HerzultForumBundle following the installing instructions and it seems that it is working, but when I try to create a topic or a post, the answer is:
Expected argument of type "object, array or empty", "string" given in /MiServer/transf/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php at line 30

if (!is_array($data) && !is_object($data)) {
throw new UnexpectedTypeException($data, 'object, array or empty');
}

I've added to my routing file the next code:

forum:
resource: @HerzultForumBundle/Resources/config/routing/forum.xml
prefix: /forum
forum_category:
resource: @HerzultForumBundle/Resources/config/routing/category.xml
prefix: /forum
forum_topic:
resource: @HerzultForumBundle/Resources/config/routing/topic.xml
prefix: /forum

I'm not sure if I'm doing anything wrong. Do you know what could it be? I've wasted a lot of time trying to fix it. Thank you

@msalsas
Copy link
Author

msalsas commented Jun 22, 2013

I solved it, but I changed two things before and I don't know wich of them has soved it.

  1. I had used a "Usuario" class, instead of "User" class. I've changed it to "User" class.
  2. I have installed the gedmo/doctrine-extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant