Entering a noteId in the AddPartyNote screen causes a foreign key error
----------------------------------------------------------------------- Key: OFBIZ-1357 URL: https://issues.apache.org/jira/browse/OFBIZ-1357 Project: OFBiz Issue Type: Bug Components: party Affects Versions: Release Branch 4.0 Environment: Windows/Linux Reporter: Skip Dever Priority: Minor Fix For: SVN trunk Log into webtools. Click on Party tab. Click on "Find..." at the bottom with all the fields blank. Select "DemoCustCompany" [Details] At the very bottom of the page, click "Create New" in the notes area. In the next screen, enter a noteId and note and click save at the bottom. You get this error: ... [noteId,DemoNote1(java.lang.String)][partyId,DemoCustCompany(java.lang.Strin g)] ... INSERT on table 'PARTY_NOTE' caused a violation of foreign key constraint 'PARTY_NOTE_NOTE' for key (DemoNote1). .... org.ofbiz.party.party.PartyServices.createPartyNote(PartyServices.java:631) If you look at the code referenced, you will note that if the "Note Id" field is left blank, the NoteData entry is created and everything works fine. It is my view that createPartyNote() should be modified to check to see if the NoteData exists if a noteId is passed and if not, one should be created or else the Note id field should be removed from (or passed as hidden) the note creation screen. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-1357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Skip Dever updated OFBIZ-1357: ------------------------------ Attachment: party.patch This patch fixes the described problem. It does three things. It adds noteName to the createPartyNote service. It makes noteId hidden and adds noteName in PartyForms.xml.AddPartyNote It adds some code in PartyServices.createPartyNote() to check if the noteId exists if it is not null and passes the noteName on to the createNote service. > Entering a noteId in the AddPartyNote screen causes a foreign key error > ----------------------------------------------------------------------- > > Key: OFBIZ-1357 > URL: https://issues.apache.org/jira/browse/OFBIZ-1357 > Project: OFBiz > Issue Type: Bug > Components: party > Affects Versions: Release Branch 4.0 > Environment: Windows/Linux > Reporter: Skip Dever > Priority: Minor > Fix For: SVN trunk > > Attachments: party.patch > > > Log into webtools. Click on Party tab. Click on "Find..." at the bottom > with all the fields blank. Select "DemoCustCompany" [Details] > At the very bottom of the page, click "Create New" in the notes area. > In the next screen, enter a noteId and note and click save at the bottom. > You get this error: > ... > [noteId,DemoNote1(java.lang.String)][partyId,DemoCustCompany(java.lang.Strin > g)] ... INSERT on table 'PARTY_NOTE' caused a violation of foreign key > constraint 'PARTY_NOTE_NOTE' for key (DemoNote1). > .... > org.ofbiz.party.party.PartyServices.createPartyNote(PartyServices.java:631) > If you look at the code referenced, you will note that if the "Note Id" > field is left blank, the NoteData entry is created and everything works > fine. > It is my view that createPartyNote() should be modified to check to see if > the NoteData exists if a noteId is passed and if not, one should be created > or else the Note id field should be removed from (or passed as hidden) the > note creation screen. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux reassigned OFBIZ-1357: -------------------------------------- Assignee: Jacques Le Roux > Entering a noteId in the AddPartyNote screen causes a foreign key error > ----------------------------------------------------------------------- > > Key: OFBIZ-1357 > URL: https://issues.apache.org/jira/browse/OFBIZ-1357 > Project: OFBiz > Issue Type: Bug > Components: party > Affects Versions: Release Branch 4.0 > Environment: Windows/Linux > Reporter: Skip Dever > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: party.patch > > > Log into webtools. Click on Party tab. Click on "Find..." at the bottom > with all the fields blank. Select "DemoCustCompany" [Details] > At the very bottom of the page, click "Create New" in the notes area. > In the next screen, enter a noteId and note and click save at the bottom. > You get this error: > ... > [noteId,DemoNote1(java.lang.String)][partyId,DemoCustCompany(java.lang.Strin > g)] ... INSERT on table 'PARTY_NOTE' caused a violation of foreign key > constraint 'PARTY_NOTE_NOTE' for key (DemoNote1). > .... > org.ofbiz.party.party.PartyServices.createPartyNote(PartyServices.java:631) > If you look at the code referenced, you will note that if the "Note Id" > field is left blank, the NoteData entry is created and everything works > fine. > It is my view that createPartyNote() should be modified to check to see if > the NoteData exists if a noteId is passed and if not, one should be created > or else the Note id field should be removed from (or passed as hidden) the > note creation screen. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536470 ] Jacques Le Roux commented on OFBIZ-1357: ---------------------------------------- Please Skip, dont use tabs in your patches. 4 spaces in any file but ftl where 2 is right. Refer to http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices in case of doubt Don't worry, I will take of them for this one ;o) Thanks for your patch > Entering a noteId in the AddPartyNote screen causes a foreign key error > ----------------------------------------------------------------------- > > Key: OFBIZ-1357 > URL: https://issues.apache.org/jira/browse/OFBIZ-1357 > Project: OFBiz > Issue Type: Bug > Components: party > Affects Versions: Release Branch 4.0 > Environment: Windows/Linux > Reporter: Skip Dever > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: party.patch > > > Log into webtools. Click on Party tab. Click on "Find..." at the bottom > with all the fields blank. Select "DemoCustCompany" [Details] > At the very bottom of the page, click "Create New" in the notes area. > In the next screen, enter a noteId and note and click save at the bottom. > You get this error: > ... > [noteId,DemoNote1(java.lang.String)][partyId,DemoCustCompany(java.lang.Strin > g)] ... INSERT on table 'PARTY_NOTE' caused a violation of foreign key > constraint 'PARTY_NOTE_NOTE' for key (DemoNote1). > .... > org.ofbiz.party.party.PartyServices.createPartyNote(PartyServices.java:631) > If you look at the code referenced, you will note that if the "Note Id" > field is left blank, the NoteData entry is created and everything works > fine. > It is my view that createPartyNote() should be modified to check to see if > the NoteData exists if a noteId is passed and if not, one should be created > or else the Note id field should be removed from (or passed as hidden) the > note creation screen. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-1357. ---------------------------------- Resolution: Fixed Thanks Skip, Your patch is in trunk revision: 589084 BTW I think that we should allow notes edition. I did it last year for a client but then forgot to back port. Anyway it's minor and another story ;o) > Entering a noteId in the AddPartyNote screen causes a foreign key error > ----------------------------------------------------------------------- > > Key: OFBIZ-1357 > URL: https://issues.apache.org/jira/browse/OFBIZ-1357 > Project: OFBiz > Issue Type: Bug > Components: party > Affects Versions: Release Branch 4.0 > Environment: Windows/Linux > Reporter: Skip Dever > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: party.patch > > > Log into webtools. Click on Party tab. Click on "Find..." at the bottom > with all the fields blank. Select "DemoCustCompany" [Details] > At the very bottom of the page, click "Create New" in the notes area. > In the next screen, enter a noteId and note and click save at the bottom. > You get this error: > ... > [noteId,DemoNote1(java.lang.String)][partyId,DemoCustCompany(java.lang.Strin > g)] ... INSERT on table 'PARTY_NOTE' caused a violation of foreign key > constraint 'PARTY_NOTE_NOTE' for key (DemoNote1). > .... > org.ofbiz.party.party.PartyServices.createPartyNote(PartyServices.java:631) > If you look at the code referenced, you will note that if the "Note Id" > field is left blank, the NoteData entry is created and everything works > fine. > It is my view that createPartyNote() should be modified to check to see if > the NoteData exists if a noteId is passed and if not, one should be created > or else the Note id field should be removed from (or passed as hidden) the > note creation screen. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539859 ] Skip Dever commented on OFBIZ-1357: ----------------------------------- Ooops, sorry, thought I got them all. > Entering a noteId in the AddPartyNote screen causes a foreign key error > ----------------------------------------------------------------------- > > Key: OFBIZ-1357 > URL: https://issues.apache.org/jira/browse/OFBIZ-1357 > Project: OFBiz > Issue Type: Bug > Components: party > Affects Versions: Release Branch 4.0 > Environment: Windows/Linux > Reporter: Skip Dever > Assignee: Jacques Le Roux > Priority: Minor > Fix For: SVN trunk > > Attachments: party.patch > > > Log into webtools. Click on Party tab. Click on "Find..." at the bottom > with all the fields blank. Select "DemoCustCompany" [Details] > At the very bottom of the page, click "Create New" in the notes area. > In the next screen, enter a noteId and note and click save at the bottom. > You get this error: > ... > [noteId,DemoNote1(java.lang.String)][partyId,DemoCustCompany(java.lang.Strin > g)] ... INSERT on table 'PARTY_NOTE' caused a violation of foreign key > constraint 'PARTY_NOTE_NOTE' for key (DemoNote1). > .... > org.ofbiz.party.party.PartyServices.createPartyNote(PartyServices.java:631) > If you look at the code referenced, you will note that if the "Note Id" > field is left blank, the NoteData entry is created and everything works > fine. > It is my view that createPartyNote() should be modified to check to see if > the NoteData exists if a noteId is passed and if not, one should be created > or else the Note id field should be removed from (or passed as hidden) the > note creation screen. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |