Answers.Body: <ol>
  <li>Can you compare your screen with this page:</li>
  </ol>
  
  <p><a href="http://wp46.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/admin/contribute/custom&amp;reset=1&amp;action=update&amp;id=2" rel="nofollow">http://wp46.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/admin/contribute/custom&amp;reset=1&amp;action=update&amp;id=2</a></p>
  
  <p>(you will need to login as demo / demo)</p>
  
  <ol start="2">
  <li><p>I suspect its not the same, and most likely there are some javascript errors occuring on your site. You should check the js console when you load the page</p></li>
  <li><p>Seems like the values submitted (i.e. a 0 for uf_group_id) is not expected and hence u get the mysql error</p></li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-04T15:18:28.653Z
Answers.Text: Yeah, a javascript error that causes badly submitted data that causes a server error, nasty! Keep that javascript console open ...
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-06T16:50:00.367Z
Answers.Text: It was not the same, but when I went back into my CiviCRM, it worked like it did in the demo. If it happens again I will keep an eye on the javascript. Thank you!
Answers.UserDisplayName: raaboyl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-04T05:09:40.987Z
Answers.LastActivityDate: 2015-06-04T05:09:40.987Z
Answers.UserDisplayName: Donald Lobo
Answers.Body: <p>It's likely a problem/conflict with the javascript from another module.</p>
  
  <p>From this thread on our old forum:
  <a href="https://forum.civicrm.org/index.php?topic=35079.msg149115#msg149115" rel="nofollow noreferrer">https://forum.civicrm.org/index.php?topic=35079.msg149115#msg149115</a></p>
  
  <p>might be "Jetpack". Try to disable it to see what's happening.</p>
  
  <p>In general: disable the other modules until you find the one that conflicts with civi</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-28T14:34:03.327Z
Answers.LastActivityDate: 2016-12-28T14:34:03.327Z
Answers.UserDisplayName: Xavier
Answers.Body: <p>I'm currently running into the same issues, which a check on the js console reveals is caused by javascript errors.</p>
  
  <p>The error message reads as follows:</p>
  
  <pre><code>JQMIGRATE: Migrate is installed, version 1.4.1 
  crm.designerapp.js?r=uMjIi:11 Uncaught TypeError: Cannot read property 'Application' of undefined
  at HTMLDocument.&lt;anonymous&gt; (crm.designerapp.js?r=uMjIi:11)
  at j (jquery.js:3148)
  at Object.fireWith [as resolveWith] (jquery.js:3260)
  at Function.ready (jquery.js:3472)
  at HTMLDocument.J (jquery.js:3503)
  backbone.collectionsubset.js?r=uMjIi:225 Uncaught TypeError: Backbone.CollectionSubset is not a constructor at child.Backbone.Collection.subcollection (backbone.collectionsubset.js?r=uMjIi:225)
  at HTMLInputElement.&lt;anonymous&gt; (jquery.crmProfileSelector.js?r=uMjIi:34)
  at Function.each (jquery.js:384)
  at m.fn.init.each (jquery.js:136)
  at m.fn.init.$.fn.crmProfileSelector (jquery.crmProfileSelector.js?r=uMjIi:25)
  at HTMLInputElement.&lt;anonymous&gt; (jquery.crmProfileSelector.js?r=uMjIi:89)
  at Function.each (jquery.js:384)
  at m.fn.init.each (jquery.js:136)
  at HTMLDivElement.&lt;anonymous&gt; (jquery.crmProfileSelector.js?r=uMjIi:88)
  at HTMLDivElement.dispatch (jquery.js:4670)
  </code></pre>
  
  <p>Any advice on resolving these errors?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-30T03:29:00.333Z
Answers.Text: Thanks, Xavier, for the heads up on Jetpack as the likely culprit. I disabled it, and lo and behold, the dropdown menus for the profiles returned. Many, many thanks!
Answers.UserDisplayName: Justin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-28T05:32:14.287Z
Answers.LastActivityDate: 2016-12-28T05:32:14.287Z
Answers.UserDisplayName: Justin
Body: <p>I cannot seem to enable profiles on contribution pages. There are no drop-down menus for including profiles, and when I try to type in an existing profile, I get a page with "DB: error: constraint violation."  What am I missing? (I am using CiviCRM 4.6.3 on Wordpress 4.2.2.)</p>
  
  <p>Update: Here is a screenshot of the page:
  <img src="https://i.sstatic.net/mn0yV.jpg" alt="enter image description here"></p>
  
  <p>Update:Here is the error/backtrace:</p>
  
  <p>Database Error Code: Cannot add or update a child row: a foreign key constraint fails (<code>rpwrhsor_civicrm</code>.<code>civicrm_uf_join</code>, CONSTRAINT <code>FK_civicrm_uf_join_uf_group_id</code> FOREIGN KEY (<code>uf_group_id</code>) REFERENCES <code>civicrm_uf_group</code> (<code>id</code>)), 1452
  Additional Details:
  Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              <a href="https://i.sstatic.net/mn0yV.jpg" rel="nofollow noreferrer">1</a> => handle
          )</p>
  
  <pre><code>[code] =&gt; -3
  [message] =&gt; DB Error: constraint violation
  [mode] =&gt; 16
  [debug_info] =&gt; INSERT INTO civicrm_uf_join (is_active , module , entity_table , entity_id , weight , uf_group_id ) VALUES ( 1 , 'CiviContribute' , 'civicrm_contribution_page' ,  3 ,  2 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rpwrhsor_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]
  [type] =&gt; DB_Error
  [user_info] =&gt; INSERT INTO civicrm_uf_join (is_active , module , entity_table , entity_id , weight , uf_group_id ) VALUES ( 1 , 'CiviContribute' , 'civicrm_contribution_page' ,  3 ,  2 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rpwrhsor_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]
  [to_string] =&gt; [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_join (is_active , module , entity_table , entity_id , weight , uf_group_id ) VALUES ( 1 , 'CiviContribute' , 'civicrm_contribution_page' ,  3 ,  2 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rpwrhsor_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]"]
  </code></pre>
  
  <p>)</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-03T16:36:21.573Z
Comments.Text: This is a good question!  To solve your problem, we'll need to see the expanded debugging information.  In CiviCRM, please go to *Administer menu > System Settings > Debugging and Error Handling*, select "Yes" to both "Enable Debugging" and "Display Backtrace", and press "Save".  Repeat the problem that caused your error, and you'll see much a much more detailed error.  Please update this question with the expanded error and backtrace - and don't forget to disable debugging/backtrace when you're done!
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-03T21:40:47.400Z
Comments.Text: OK - I think this error might be a red herring.  I should have paid more attention to the part where you said you "tried to type in an existing profile".  That should be impossible, and your error is tied to that.  Can you please post a screenshot of what the "Include Profiles" screen on looks like when you're managing this contribution page?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-03T22:58:36.577Z
Comments.Text: I added the screenshot
Comments.UserDisplayName: raaboyl
Tags: <civicontribute><profile>
Title: DB Error: constraint violation when I try to add profiles to contribution page
ThreadText: # DB Error: constraint violation when I try to add profiles to contribution page
  
  (Asked by: username_0 on 2015-06-03)
  
  I cannot seem to enable profiles on contribution pages. There are no drop-down menus for including profiles, and when I try to type in an existing profile, I get a page with "DB: error: constraint violation."  What am I missing? (I am using CiviCRM 4.6.3 on Wordpress 4.2.2.)
  Update: Here is a screenshot of the page:
  
  Update:Here is the error/backtrace:
  Database Error Code: Cannot add or update a child row: a foreign key constraint fails (rpwrhsor_civicrm.civicrm_uf_join, CONSTRAINT FK_civicrm_uf_join_uf_group_id FOREIGN KEY (uf_group_id) REFERENCES civicrm_uf_group (id)), 1452
  Additional Details:
  Array
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              1 => handle
          )
  [code] => -3
  [message] => DB Error: constraint violation
  [mode] => 16
  [debug_info] => INSERT INTO civicrm_uf_join (is_active , module , entity_table , entity_id , weight , uf_group_id ) VALUES ( 1 , 'CiviContribute' , 'civicrm_contribution_page' ,  3 ,  2 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rpwrhsor_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]
  [type] => DB_Error
  [user_info] => INSERT INTO civicrm_uf_join (is_active , module , entity_table , entity_id , weight , uf_group_id ) VALUES ( 1 , 'CiviContribute' , 'civicrm_contribution_page' ,  3 ,  2 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rpwrhsor_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]
  [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_uf_join (is_active , module , entity_table , entity_id , weight , uf_group_id ) VALUES ( 1 , 'CiviContribute' , 'civicrm_contribution_page' ,  3 ,  2 ,  0 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`rpwrhsor_civicrm`.`civicrm_uf_join`, CONSTRAINT `FK_civicrm_uf_join_uf_group_id` FOREIGN KEY (`uf_group_id`) REFERENCES `civicrm_uf_group` (`id`))]"]
  
  )
  
  **Tags:** civicontribute, profile
  
  > **Comments:**
  > **username_1**: This is a good question!  To solve your problem, we'll need to see the expanded debugging information.  In CiviCRM, please go to *Administer menu > System Settings > Debugging and Error Handling*, select "Yes" to both "Enable Debugging" and "Display Backtrace", and press "Save".  Repeat the problem that caused your error, and you'll see much a much more detailed error.  Please update this question with the expanded error and backtrace - and don't forget to disable debugging/backtrace when you're done!  
  > **username_1**: OK - I think this error might be a red herring.  I should have paid more attention to the part where you said you "tried to type in an existing profile".  That should be impossible, and your error is tied to that.  Can you please post a screenshot of what the "Include Profiles" screen on looks like when you're managing this contribution page?  
  > **username_0**: I added the screenshot  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2015-06-04. Score: 1
  
  1. Can you compare your screen with this page:
  
  <http://wp46.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/admin/contribute/custom&reset=1&action=update&id=2>
  
  (you will need to login as demo / demo)
  
  2. I suspect its not the same, and most likely there are some javascript errors occuring on your site. You should check the js console when you load the page
  3. Seems like the values submitted (i.e. a 0 for uf\_group\_id) is not expected and hence u get the mysql error
  
  > **Comments:**
  > **username_3**: Yeah, a javascript error that causes badly submitted data that causes a server error, nasty! Keep that javascript console open ...  
  > **username_0**: It was not the same, but when I went back into my CiviCRM, it worked like it did in the demo. If it happens again I will keep an eye on the javascript. Thank you!  
  
  ---
  
  ### Answer by username_4 on 2016-12-28. Score: 0
  
  It's likely a problem/conflict with the javascript from another module.
  
  From this thread on our old forum:
  <https://forum.civicrm.org/index.php?topic=35079.msg149115#msg149115>
  
  might be "Jetpack". Try to disable it to see what's happening.
  
  In general: disable the other modules until you find the one that conflicts with civi
  
  
  ---
  
  ### Answer by username_5 on 2016-12-28. Score: 0
  
  I'm currently running into the same issues, which a check on the js console reveals is caused by javascript errors.
  The error message reads as follows:
  JQMIGRATE: Migrate is installed, version 1.4.1 
  crm.designerapp.js?r=uMjIi:11 Uncaught TypeError: Cannot read property 'Application' of undefined
  at HTMLDocument. (crm.designerapp.js?r=uMjIi:11)
  at j (jquery.js:3148)
  at Object.fireWith [as resolveWith] (jquery.js:3260)
  at Function.ready (jquery.js:3472)
  at HTMLDocument.J (jquery.js:3503)
  backbone.collectionsubset.js?r=uMjIi:225 Uncaught TypeError: Backbone.CollectionSubset is not a constructor at child.Backbone.Collection.subcollection (backbone.collectionsubset.js?r=uMjIi:225)
  at HTMLInputElement. (jquery.crmProfileSelector.js?r=uMjIi:34)
  at Function.each (jquery.js:384)
  at m.fn.init.each (jquery.js:136)
  at m.fn.init.$.fn.crmProfileSelector (jquery.crmProfileSelector.js?r=uMjIi:25)
  at HTMLInputElement. (jquery.crmProfileSelector.js?r=uMjIi:89)
  at Function.each (jquery.js:384)
  at m.fn.init.each (jquery.js:136)
  at HTMLDivElement. (jquery.crmProfileSelector.js?r=uMjIi:88)
  at HTMLDivElement.dispatch (jquery.js:4670)
  
  Any advice on resolving these errors?
  
  > **Comments:**
  > **username_5**: Thanks, username_4, for the heads up on Jetpack as the likely culprit. I disabled it, and lo and behold, the dropdown menus for the profiles returned. Many, many thanks!  
  
  ---
  
  