What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello guys, Please take a look of this code. I want to update the data, But it's giving me this erro
Hello guys, Please take a look of this code. I want to update the data, But it's giving me this error. Could you help me in it?
Comments
-
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
The exception says there is already an entry with the same value in the table
0 -
Yes, And I want update that value.
0 -
Seems that the SchoolTransfer doesn't have the idSchool property set. You probably want to update an existing school in db instead of creating a new one. But without the id being set, it doesn't know which entity to update and rather will create another one.
0 -
idSchool is available there.
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
either that what Kay says or the saveSchool implementation is not differentiating between create and update
0 -
I'd suggest to debug into SchoolFacade. Should be easy to find out.
0 -
How can I update those value?
0 -
Ok.
0 -
Another reason might be a unique constraint on the name column.
0 -
Is it right for update functionality?
0 -
Please get familiar with debugging instead of posting dumps.
0 -
And check the schema.xml file for a unique constraint on the name column and remove, if you don't need it.
0 -
Ok.
0 -
I have removed the unique constraint but it still giving me same error.
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
the unique constraint seems to be not your main problem. if you updated the schema-file you should not forget to run propel:install
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
please look for SchoolFacade.php - there must be a method
saveSchool
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
which likely uses the entityManager directly or a writer-helper class
0 -
fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βοΈ - Guardians (admin)
and please, like Kay mentioned: get familiar how to use xdebug in visual studio code
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random