Skip to content

Commit

Permalink
Merge pull request #20815 from civicrm/5.40
Browse files Browse the repository at this point in the history
5.40 to master
  • Loading branch information
eileenmcnaughton authored Jul 8, 2021
2 parents f87ae74 + 3efec37 commit 09e790b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CRM/Upgrade/Incremental/php/FiveForty.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public static function addGroupOptionList(CRM_Queue_TaskContext $ctx) {
*/
public static function addContributionProductFK(CRM_Queue_TaskContext $ctx): bool {
if (!self::checkFKExists('civicrm_contribution_product', 'FK_civicrm_contribution_product_product_id')) {
// dev/core#2680 Clear out any rows with problematic product_ids from the civicrm_contribution_product table.
CRM_Core_DAO::executeQuery("DELETE FROM civicrm_contribution_product WHERE product_id NOT IN (SELECT id FROM civicrm_product)");
CRM_Core_DAO::executeQuery("
ALTER TABLE `civicrm_contribution_product`
ADD CONSTRAINT `FK_civicrm_contribution_product_product_id`
Expand Down

0 comments on commit 09e790b

Please sign in to comment.