From 845b591530c2a85d426afc2c61258e4ee61ad08b Mon Sep 17 00:00:00 2001 From: burnout87 Date: Mon, 6 May 2024 15:39:18 +0200 Subject: [PATCH 1/6] version footer frontend --- templates/mmoda-main.tpl.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/mmoda-main.tpl.php b/templates/mmoda-main.tpl.php index 1257f4e..51e8f51 100644 --- a/templates/mmoda-main.tpl.php +++ b/templates/mmoda-main.tpl.php @@ -296,6 +296,8 @@ class="glyphicon glyphicon-info-sign"> +
+
version: 1.0.0
From 640fc08b02e20b68d7cf86a443249fd0cd59433d Mon Sep 17 00:00:00 2001 From: burnout87 Date: Mon, 6 May 2024 17:14:40 +0200 Subject: [PATCH 2/6] frontend version loaded from install module --- mmoda.install | 1 + mmoda.module | 3 +++ templates/mmoda-main.tpl.php | 11 +++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mmoda.install b/mmoda.install index 71f1243..96f9f40 100644 --- a/mmoda.install +++ b/mmoda.install @@ -133,6 +133,7 @@ function mmoda_install() $module_settings['common']['T2'] = '2017-03-06T15:32:27.0'; $module_settings['common']['T_format'] = 'isot'; $module_settings[$module_name . '_debug'] = true; + $module_settings['frontend_version'] = 'test_frontend_version'; $module_settings['modules'] = array(); // Create role for user managers diff --git a/mmoda.module b/mmoda.module index eb0ed93..ea7d1d2 100644 --- a/mmoda.module +++ b/mmoda.module @@ -365,11 +365,14 @@ function mmoda_main_block_content() // $mmoda_settings ['support_email'] = array('mohamed.meharga@unige.ch'); // variable_set ( 'mmoda_settings', $mmoda_settings ); + watchdog('MMODA', 'content of mmoda_settings: ' . print_r($mmoda_settings, true)); + $items['session_id'] = $session_id; $items['session_count'] = $session_count; $items['name_resolve_form'] = drupal_get_form('mmoda_name_resolve'); $items['common_form'] = drupal_get_form('mmoda_common'); $items['mmoda_debug'] = $mmoda_settings['mmoda_debug']; + $items['frontend_version'] = $mmoda_settings['frontend_version']; $items['auth_cookie'] = '_oauth2_proxy'; if (empty($mmoda_settings['instruments'])) { diff --git a/templates/mmoda-main.tpl.php b/templates/mmoda-main.tpl.php index 51e8f51..1f7af2e 100644 --- a/templates/mmoda-main.tpl.php +++ b/templates/mmoda-main.tpl.php @@ -296,14 +296,21 @@ class="glyphicon glyphicon-info-sign"> -
-
version: 1.0.0
+ +
+
version:
+ + +
+
version:
+ + From b715980a7fed4bf63970ec95a7d569f92c2476fc Mon Sep 17 00:00:00 2001 From: burnout87 Date: Mon, 13 May 2024 18:40:01 +0200 Subject: [PATCH 3/6] extract frontend version from the DB --- mmoda.install | 2 +- mmoda.lib.inc | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mmoda.install b/mmoda.install index 96f9f40..254891a 100644 --- a/mmoda.install +++ b/mmoda.install @@ -133,7 +133,7 @@ function mmoda_install() $module_settings['common']['T2'] = '2017-03-06T15:32:27.0'; $module_settings['common']['T_format'] = 'isot'; $module_settings[$module_name . '_debug'] = true; - $module_settings['frontend_version'] = 'test_frontend_version'; + $module_settings['frontend_version'] = mmode_get_frontend_version(); $module_settings['modules'] = array(); // Create role for user managers diff --git a/mmoda.lib.inc b/mmoda.lib.inc index 683eeb0..e383d48 100644 --- a/mmoda.lib.inc +++ b/mmoda.lib.inc @@ -432,6 +432,25 @@ function mmoda_get_users_with_role($role, $active_user = TRUE) return $users; } +function mmode_get_frontend_version() +{ + $version = ''; + $query = db_select('variable', 'var') + ->fields('var', array('value')) + ->condition('var.name', 'mmoda_frontend_version'); + // watchdog('MMODA', 'query to fetch frontend version: ' . $query, WATCHDOG_DEBUG); + $query_result = $query->execute()->fetch(); + + if (!empty($query_result)) { + watchdog('MMODA', 'result query to fetch frontend version: ' . $query_result->value); + $version = $query_result->value; + } + else + watchdog('MMODA', 'frontened version not found in the database.'); + + return $version; +} + function _mmoda_write_log_file($filename, $content) { $filename = '/tmp/' . $filename; From 644902f74153bc6c2d9b6f6f70644c99e5e2c150 Mon Sep 17 00:00:00 2001 From: burnout87 Date: Fri, 24 May 2024 12:42:53 +0200 Subject: [PATCH 4/6] extracting version from info file --- mmoda.info | 1 + mmoda.install | 11 +++++++---- mmoda.lib.inc | 19 ++++++++++++------- mmoda.module | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/mmoda.info b/mmoda.info index 2523651..de0f552 100644 --- a/mmoda.info +++ b/mmoda.info @@ -1,6 +1,7 @@ name = MMODA description = Multi-Messenger Online Data Analysis core = 7.x +version = 7.x-1.0 dependencies[] = libraries:libraries (2.x) dependencies[] = drupal:block dependencies[] = drupal:book diff --git a/mmoda.install b/mmoda.install index 254891a..3f92365 100644 --- a/mmoda.install +++ b/mmoda.install @@ -91,14 +91,17 @@ function mmoda_add_custom_fields() field_create_field($field); } foreach (mmoda_help_page_field_default_field_instances() as $instance) { - field_create_instance($instance); + if(!is_null($instance)) + field_create_instance($instance); } } function mmoda_del_custom_fields() { foreach (mmoda_help_page_field_default_field_instances() as $instance) { - field_delete_instance($instance); + if (!is_null($instance)) { + field_delete_instance($instance); + } } // foreach (array_keys(mmoda_help_page_field_default_field_bases()) as $field) { // field_delete_field($field); @@ -133,7 +136,7 @@ function mmoda_install() $module_settings['common']['T2'] = '2017-03-06T15:32:27.0'; $module_settings['common']['T_format'] = 'isot'; $module_settings[$module_name . '_debug'] = true; - $module_settings['frontend_version'] = mmode_get_frontend_version(); + $module_settings['frontend_version'] = mmoda_get_frontend_version(); $module_settings['modules'] = array(); // Create role for user managers @@ -172,7 +175,7 @@ function mmoda_install() // variable_set('menu_options_'.$help_page_content_type, array(0)); // Add custom fields to book page content type - mmoda_add_custom_fields(); + // mmoda_add_custom_fields(); $book_allowed_types = variable_get('book_allowed_types', array( 'book' diff --git a/mmoda.lib.inc b/mmoda.lib.inc index e383d48..daaea53 100644 --- a/mmoda.lib.inc +++ b/mmoda.lib.inc @@ -432,18 +432,23 @@ function mmoda_get_users_with_role($role, $active_user = TRUE) return $users; } -function mmode_get_frontend_version() +function mmoda_get_frontend_version() { - $version = ''; - $query = db_select('variable', 'var') - ->fields('var', array('value')) - ->condition('var.name', 'mmoda_frontend_version'); + $version = 'test'; + // $query = db_select('variable', 'var') + // ->fields('var', array('value')) + // ->condition('var.name', 'mmoda_frontend_version'); + + $query = db_select('system', 'sys'); + $query->addExpression('CONVERT(sys.info USING utf8)', 'info'); + $query->condition('sys.name', 'mmoda'); // watchdog('MMODA', 'query to fetch frontend version: ' . $query, WATCHDOG_DEBUG); $query_result = $query->execute()->fetch(); if (!empty($query_result)) { - watchdog('MMODA', 'result query to fetch frontend version: ' . $query_result->value); - $version = $query_result->value; + $unserialized_info = unserialize($query_result->info); + $version = "{$unserialized_info['version']}"; + // watchdog('MMODA', 'result query to fetch frontend, version: ' . $version); } else watchdog('MMODA', 'frontened version not found in the database.'); diff --git a/mmoda.module b/mmoda.module index ea7d1d2..e00e4f1 100644 --- a/mmoda.module +++ b/mmoda.module @@ -365,7 +365,7 @@ function mmoda_main_block_content() // $mmoda_settings ['support_email'] = array('mohamed.meharga@unige.ch'); // variable_set ( 'mmoda_settings', $mmoda_settings ); - watchdog('MMODA', 'content of mmoda_settings: ' . print_r($mmoda_settings, true)); + // watchdog('MMODA', 'content of mmoda_settings: ' . var_dump($mmoda_settings)); $items['session_id'] = $session_id; $items['session_count'] = $session_count; From 9ca5a993c2a87badb34f84fcd6dd9661e4cd8bfd Mon Sep 17 00:00:00 2001 From: burnout87 Date: Fri, 24 May 2024 12:43:30 +0200 Subject: [PATCH 5/6] removed not needed code --- mmoda.lib.inc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mmoda.lib.inc b/mmoda.lib.inc index daaea53..716ab90 100644 --- a/mmoda.lib.inc +++ b/mmoda.lib.inc @@ -434,21 +434,16 @@ function mmoda_get_users_with_role($role, $active_user = TRUE) function mmoda_get_frontend_version() { - $version = 'test'; - // $query = db_select('variable', 'var') - // ->fields('var', array('value')) - // ->condition('var.name', 'mmoda_frontend_version'); + $version = ''; $query = db_select('system', 'sys'); $query->addExpression('CONVERT(sys.info USING utf8)', 'info'); $query->condition('sys.name', 'mmoda'); - // watchdog('MMODA', 'query to fetch frontend version: ' . $query, WATCHDOG_DEBUG); $query_result = $query->execute()->fetch(); if (!empty($query_result)) { $unserialized_info = unserialize($query_result->info); $version = "{$unserialized_info['version']}"; - // watchdog('MMODA', 'result query to fetch frontend, version: ' . $version); } else watchdog('MMODA', 'frontened version not found in the database.'); From cdaec3a07bc7e6d9e43db41be5946ebf73acfad4 Mon Sep 17 00:00:00 2001 From: burnout87 Date: Wed, 5 Jun 2024 11:55:41 +0200 Subject: [PATCH 6/6] ignore modules --- instruments/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instruments/.gitignore b/instruments/.gitignore index 7a098c9..a4178eb 100644 --- a/instruments/.gitignore +++ b/instruments/.gitignore @@ -5,3 +5,5 @@ /mmoda_nb2w_example/ /mmoda_euclid/ /mmoda_icecube/ +/mmoda_photoz_euclid/ +/mmoda_ctaimaging/ \ No newline at end of file