0

In my Sulu system I want to create a new bundle that extends the Sulu contacts. So basically I want to have an own bundle that saves a different type of contact in its own table with additional information.

In the Sulu documentation it says:

You can specify your new Entity and if it exists your Repository in the sulu_security configuration section.

There are so many configuration files in Sulu and now I don't know where to put these lines.

I have set up my classes correctly but Sulu throws a JSON.parse error which I think is related to the missing configuration lines.

I'd be glad if anyone can point me in the right direction.

Julien Rousé
  • 1,115
  • 1
  • 15
  • 30

1 Answers1

0

JSON.parse sounds like a JSON parse error and not like an error when you have these config lines missing.

If you use the new entity contacts also in your website you can place the configuration in /app/config/config.yml.

My config looks like this:

sulu_contact:
    objects:
        contact:
            model: vdsmh\AppBundle\Entity\Member
Nathan Waelkens
  • 319
  • 2
  • 8
  • It would be helpful if you could post more code or errors from your logfile /var/logs/{admin|website}/dev/dev.log etc. – Nathan Waelkens Jan 25 '18 at 08:12
  • The JSON.parse error was simply because of changes in JavaScript I missed. I just had to run `grunt build` and the error was gone. But the config to make my Contact extension work is now working. Thanks a lot. – Laggertron Jan 26 '18 at 12:36
  • On question though: If I use this configuration it replaces the old contacts completely and tries to reference `idContacts` to my new Entity in `se_users`. Are any inheritaces of contacts bind to be a sulu user? – Laggertron Jan 31 '18 at 09:46
  • Not that I'm aware of. What I did btw is name the new contact table exactly as the old one. It kept my data, so also any current references. Using annotations: `@ORM\Table("co_contacts")` – Nathan Waelkens Feb 01 '18 at 09:18
  • BTW: If you need more help - join the Slack channel. See the bottom of this page: https://sulu.io/en/contact – Nathan Waelkens Feb 04 '18 at 08:49