From 45ed0248c08e29980d0a7aa010f45afd5b298904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Jacquet?= Date: Mon, 13 Jul 2020 17:09:09 +0200 Subject: [PATCH] Fix SQL error foreign keys: Roll again Courses when rolling Marking Periods --- CHANGES.md | 1 + modules/School_Setup/Rollover.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index fab580c1..cb0f37b7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Changes in 6.8 - Fix #291 XSS Use URLEscape() for links href, program wide - Fix hide remove button for "No Address" in Address.inc.php - Prompt() make Cancel primary button in Prompts.php +- Fix SQL error foreign keys: Roll again Courses when rolling Marking Periods in Rollover.php Changes in 6.7.2 ---------------- diff --git a/modules/School_Setup/Rollover.php b/modules/School_Setup/Rollover.php index 4e77e6a0..2a0cdc2c 100644 --- a/modules/School_Setup/Rollover.php +++ b/modules/School_Setup/Rollover.php @@ -95,6 +95,14 @@ if ( Prompt( $_REQUEST['tables']['REPORT_CARD_COMMENTS'] = 'Y'; } + if ( $_REQUEST['tables']['SCHOOL_MARKING_PERIODS'] + && $exists_RET['COURSES'][1]['COUNT'] + && ! $_REQUEST['tables']['COURSES'] ) + { + // Fix SQL error foreign keys: Roll again Courses when rolling Marking Periods. + $_REQUEST['tables']['COURSES'] = 'Y'; + } + if ( ! ( $_REQUEST['tables']['COURSES'] && ( ( ! $_REQUEST['tables']['STAFF'] && $exists_RET['STAFF'][1]['COUNT'] < 1 ) || ( ! $_REQUEST['tables']['SCHOOL_PERIODS'] && $exists_RET['SCHOOL_PERIODS'][1]['COUNT'] < 1 ) -- GitLab