The Higher Education and Research forge

Home My Page Projects Code Snippets Project Openings MonLabo
Summary Activity Tracker Tasks Docs SCM Files Dokuwiki Continious Integration Listes Sympa

SCM Repository

authorHerve Suaudeau <herve.suaudeau@parisdescartes.fr>
Wed, 23 Sep 2020 16:05:19 +0000 (18:05 +0200)
committerHerve Suaudeau <herve.suaudeau@parisdescartes.fr>
Wed, 23 Sep 2020 16:05:19 +0000 (18:05 +0200)
includes/MonLabo-db.php
mon-laboratoire.php

index 2e78f07..1262a6e 100644 (file)
@@ -166,7 +166,6 @@ class MonLabo_db {
        }
 
        public function fill_tables_with_default_values_if_empty() {
-
                global $wpdb;
                $MonLabo_access_data = New MonLabo_access_data();
                $empty_MonLabo_persons = false;
@@ -328,6 +327,7 @@ class MonLabo_db {
        }
 
        public function migrate() {
+
                global $wpdb;
                $sql = $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", 'MonLabo_settings_group0' );
 
@@ -346,6 +346,10 @@ class MonLabo_db {
                        if ( ( $plugin_version < 3.1 ) ) {
                                $this->migrate_to_version_3_1();
                        }
+
+                       //Mise à jour de la version activée
+                       $options0['MonLabo_activated_version'] = get_version();
+                       update_option( 'MonLabo_settings_group0', $options0 );
                        return $this;
                }
        }
@@ -375,6 +379,7 @@ class MonLabo_db {
                        $options5['MonLabo_custom_text_Thematics_en'] =  $options0['MonLabo_teamGroupName_en_pl'];
                        unset( $options0['MonLabo_teamGroupName_en_pl'] );
                }
+               delete_option( 'MonLabo_settings_group0' );
                update_option( 'MonLabo_settings_group0', $options0 );
                update_option( 'MonLabo_settings_group5', $options5 );
        }
index e56eac6..fedca86 100644 (file)
@@ -172,8 +172,7 @@ if ( !class_exists( 'MonLabo' ) ) {
 function activate_MonLabo() {
        $MonLabo_DB = New MonLabo_db();
        $options0 = get_option( 'MonLabo_settings_group0' );
-
-       if(($MonLabo_DB->check_tables_exist()) or ($MonLabo_DB->check_tables_exist("{$wpdb->prefix}MonLabo_persons"))) {
+       if( $MonLabo_DB->check_tables_exist() ) {
                if ( ( !isset( $options0 ) )
                        or ( !isset( $options0['MonLabo_activated_version'] ) )
                        or ( $options0['MonLabo_activated_version'] != get_version() )