diff --git a/src/changelog.txt b/src/changelog.txt index c767d4a8..f1d08410 100644 --- a/src/changelog.txt +++ b/src/changelog.txt @@ -13,6 +13,11 @@ "ONLY_FULL_GROUP_BY" MySQL setting. Closes #167: "Manage transcripts feature doesn't allow addition of transcript anymore". + * Fixed several problems with MySQL's new default strict mode. LOVD wasn't + installable, and transcripts couldn't be created if this setting was enabled. + Closes #143: "LOVD won't install with error "Invalid default value for + 'start_date'"" + Closes #173: "Installation failed on ubuntu 16" * Fixed bug; The "all variants affecting transcripts" view showed only one entry. This was caused by the recent changes making LOVD compatible with the new default "ONLY_FULL_GROUP_BY" MySQL setting. diff --git a/src/class/PDO.php b/src/class/PDO.php index bae2cce9..4bbb1ca0 100644 --- a/src/class/PDO.php +++ b/src/class/PDO.php @@ -4,12 +4,12 @@ * LEIDEN OPEN VARIATION DATABASE (LOVD) * * Created : 2011-08-17 - * Modified : 2016-10-14 - * For LOVD : 3.0-18 + * Modified : 2017-01-25 + * For LOVD : 3.0-19 * - * Copyright : 2004-2016 Leiden University Medical Center; http://www.LUMC.nl/ - * Programmers : Ing. Ivo F.A.C. Fokkema - * Ing. Ivar C. Lugtenburg + * Copyright : 2004-2017 Leiden University Medical Center; http://www.LUMC.nl/ + * Programmers : Ivo F.A.C. Fokkema + * Ivar C. Lugtenburg * * * This file is part of LOVD. @@ -59,7 +59,7 @@ function __construct ($sBackend, $sDSN, $sUsername = '', $sPassword = '') // Still needs check though, in case two PDO connections are opened. define('MYSQL_ATTR_INIT_COMMAND', 1002); } - $aOptions = array(MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE); + $aOptions = array(MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8, SQL_MODE = REPLACE(@@SQL_MODE, "NO_ZERO_DATE", "")', PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => TRUE); } try { parent::__construct($sDSN, $sUsername, $sPassword, $aOptions); diff --git a/src/genes.php b/src/genes.php index 7294926c..187fa580 100644 --- a/src/genes.php +++ b/src/genes.php @@ -4,13 +4,13 @@ * LEIDEN OPEN VARIATION DATABASE (LOVD) * * Created : 2010-12-15 - * Modified : 2016-10-14 - * For LOVD : 3.0-18 + * Modified : 2017-01-25 + * For LOVD : 3.0-19 * - * Copyright : 2004-2016 Leiden University Medical Center; http://www.LUMC.nl/ - * Programmers : Ing. Ivo F.A.C. Fokkema - * Ing. Ivar C. Lugtenburg - * Msc. Daan Asscheman + * Copyright : 2004-2017 Leiden University Medical Center; http://www.LUMC.nl/ + * Programmers : Ivo F.A.C. Fokkema + * Ivar C. Lugtenburg + * Daan Asscheman * David Baux * M. Kroon * @@ -522,6 +522,7 @@ function lovd_prepareCuratorLogMessage($sGeneID, $aCurators, $aAllowEdit, $aShow 'id_protein_ncbi' => $zData['transcriptsProtein'][$sTranscript], 'id_protein_ensembl' => '', 'id_protein_uniprot' => '', + 'remarks' => '', 'position_c_mrna_start' => $zData['transcriptPositions'][$sTranscript]['cTransStart'], 'position_c_mrna_end' => $zData['transcriptPositions'][$sTranscript]['cTransEnd'], 'position_c_cds_end' => $zData['transcriptPositions'][$sTranscript]['cCDSStop'], @@ -549,9 +550,9 @@ function lovd_prepareCuratorLogMessage($sGeneID, $aCurators, $aAllowEdit, $aShow $sTranscriptName = $zData['transcriptNames'][$sTranscript]; $aTranscriptPositions = $zData['transcriptPositions'][$sTranscript]; // Add transcript to gene. - $q = $_DB->query('INSERT INTO ' . TABLE_TRANSCRIPTS . '(id, geneid, name, id_mutalyzer, id_ncbi, id_ensembl, id_protein_ncbi, id_protein_ensembl, id_protein_uniprot, position_c_mrna_start, position_c_mrna_end, position_c_cds_end, position_g_mrna_start, position_g_mrna_end, created_date, created_by) ' . - 'VALUES(NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), ?)', - array($_POST['id'], $sTranscriptName, $nMutalyzerID, $sTranscript, '', $sTranscriptProtein, '', '', $aTranscriptPositions['cTransStart'], $aTranscriptPositions['cTransEnd'], $aTranscriptPositions['cCDSStop'], $aTranscriptPositions['chromTransStart'], $aTranscriptPositions['chromTransEnd'], $_POST['created_by'])); + $q = $_DB->query('INSERT INTO ' . TABLE_TRANSCRIPTS . '(id, geneid, name, id_mutalyzer, id_ncbi, id_ensembl, id_protein_ncbi, id_protein_ensembl, id_protein_uniprot, remarks, position_c_mrna_start, position_c_mrna_end, position_c_cds_end, position_g_mrna_start, position_g_mrna_end, created_date, created_by) ' . + 'VALUES(NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), ?)', + array($_POST['id'], $sTranscriptName, $nMutalyzerID, $sTranscript, '', $sTranscriptProtein, '', '', '', $aTranscriptPositions['cTransStart'], $aTranscriptPositions['cTransEnd'], $aTranscriptPositions['cCDSStop'], $aTranscriptPositions['chromTransStart'], $aTranscriptPositions['chromTransEnd'], $_POST['created_by'])); if (!$q) { // Silent error. lovd_writeLog('Error', LOG_EVENT, 'Transcript information entry ' . $sTranscript . ' - ' . ' - could not be added to gene ' . $_POST['id']); diff --git a/src/install/index.php b/src/install/index.php index 6abf77da..816510a9 100644 --- a/src/install/index.php +++ b/src/install/index.php @@ -4,13 +4,13 @@ * LEIDEN OPEN VARIATION DATABASE (LOVD) * * Created : 2009-10-19 - * Modified : 2016-10-14 - * For LOVD : 3.0-18 + * Modified : 2017-01-25 + * For LOVD : 3.0-19 * - * Copyright : 2004-2016 Leiden University Medical Center; http://www.LUMC.nl/ - * Programmers : Ing. Ivo F.A.C. Fokkema - * Ing. Ivar C. Lugtenburg - * Msc. Daan Asscheman + * Copyright : 2004-2017 Leiden University Medical Center; http://www.LUMC.nl/ + * Programmers : Ivo F.A.C. Fokkema + * Ivar C. Lugtenburg + * Daan Asscheman * * * This file is part of LOVD. @@ -536,7 +536,7 @@ function lovd_printSideBar () // (10) Creating the "Healthy / Control" disease. Maybe later enable some more default columns? (IQ, ...) $aInstallSQL['Registering phenotype columns for healthy controls...'] = array( - 'INSERT INTO ' . TABLE_DISEASES . ' (symbol, name, created_by, created_date) VALUES ("Healthy/Control", "Healthy individual / control", 0, NOW())', + 'INSERT INTO ' . TABLE_DISEASES . ' (symbol, name, tissues, features, remarks, created_by, created_date) VALUES ("Healthy/Control", "Healthy individual / control", "", "", "", 0, NOW())', 'UPDATE ' . TABLE_DISEASES . ' SET id = 0', 'ALTER TABLE ' . TABLE_DISEASES . ' auto_increment = 1', // FIXME: Rather parse inc-sql-columns then to do this manually. diff --git a/src/transcripts.php b/src/transcripts.php index 259f3150..edb7805c 100644 --- a/src/transcripts.php +++ b/src/transcripts.php @@ -4,13 +4,13 @@ * LEIDEN OPEN VARIATION DATABASE (LOVD) * * Created : 2010-12-21 - * Modified : 2016-07-18 - * For LOVD : 3.0-17 + * Modified : 2017-01-25 + * For LOVD : 3.0-19 * - * Copyright : 2004-2016 Leiden University Medical Center; http://www.LUMC.nl/ - * Programmers : Ing. Ivar C. Lugtenburg - * Ing. Ivo F.A.C. Fokkema - * Msc. Daan Asscheman + * Copyright : 2004-2017 Leiden University Medical Center; http://www.LUMC.nl/ + * Programmers : Ivar C. Lugtenburg + * Ivo F.A.C. Fokkema + * Daan Asscheman * M. Kroon * * @@ -331,6 +331,7 @@ 'id_protein_ncbi' => $zData['transcriptsProtein'][$sTranscript], 'id_protein_ensembl' => '', 'id_protein_uniprot' => '', + 'remarks' => '', 'position_c_mrna_start' => $zData['transcriptPositions'][$sTranscript]['cTransStart'], 'position_c_mrna_end' => $zData['transcriptPositions'][$sTranscript]['cTransEnd'], // Is actually sortableTransEnd. 'position_c_cds_end' => $zData['transcriptPositions'][$sTranscript]['cCDSStop'], @@ -357,9 +358,9 @@ $sTranscriptName = $zData['transcriptNames'][$sTranscript]; $aTranscriptPositions = $zData['transcriptPositions'][$sTranscript]; - $q = $_DB->query('INSERT INTO ' . TABLE_TRANSCRIPTS . '(id, geneid, name, id_mutalyzer, id_ncbi, id_ensembl, id_protein_ncbi, id_protein_ensembl, id_protein_uniprot, position_c_mrna_start, position_c_mrna_end, position_c_cds_end, position_g_mrna_start, position_g_mrna_end, created_date, created_by) ' . - 'VALUES(NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), ?)', - array($zData['gene']['id'], $sTranscriptName, $nMutalyzerID, $sTranscript, '', $sTranscriptProtein, '', '', $aTranscriptPositions['cTransStart'], $aTranscriptPositions['cTransEnd'], $aTranscriptPositions['cCDSStop'], $aTranscriptPositions['chromTransStart'], $aTranscriptPositions['chromTransEnd'], $_POST['created_by'])); + $q = $_DB->query('INSERT INTO ' . TABLE_TRANSCRIPTS . '(id, geneid, name, id_mutalyzer, id_ncbi, id_ensembl, id_protein_ncbi, id_protein_ensembl, id_protein_uniprot, remarks, position_c_mrna_start, position_c_mrna_end, position_c_cds_end, position_g_mrna_start, position_g_mrna_end, created_date, created_by) ' . + 'VALUES(NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NOW(), ?)', + array($zData['gene']['id'], $sTranscriptName, $nMutalyzerID, $sTranscript, '', $sTranscriptProtein, '', '', '', $aTranscriptPositions['cTransStart'], $aTranscriptPositions['cTransEnd'], $aTranscriptPositions['cCDSStop'], $aTranscriptPositions['chromTransStart'], $aTranscriptPositions['chromTransEnd'], $_POST['created_by'])); if (!$q) { // Silent error. lovd_writeLog('Error', LOG_EVENT, 'Transcript information entry ' . $sTranscript . ' - could not be added to gene ' . $zData['gene']['id']);