From 80a7c7c46b4528829b6d8259c3d89bb963c1a776 Mon Sep 17 00:00:00 2001 From: Sol Villar Date: Fri, 5 Aug 2016 00:03:38 -0300 Subject: [PATCH 1/2] Added check to avoid definition of class multiple times. --- modules/open_data_schema_pod/open_data_schema_pod.module | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/open_data_schema_pod/open_data_schema_pod.module b/modules/open_data_schema_pod/open_data_schema_pod.module index d78225b..cc31ddd 100644 --- a/modules/open_data_schema_pod/open_data_schema_pod.module +++ b/modules/open_data_schema_pod/open_data_schema_pod.module @@ -390,7 +390,9 @@ function open_data_schema_pod_accrual_iso_8601() { * Validates individual datasets. */ function open_data_schema_pod_process_validate($url, $clear_cache = FALSE) { - include 'podValidator.php'; + if (!class_exists('podValidator\validate')) { + include 'podValidator.php'; + } if (!$clear_cache && $cache = cache_get('pod_validate_result')) { $results = $cache->data; $results['cache_date'] = $cache->created; From 2b1b9af9ba5f5ff642215832920a61a9bcfbc9bb Mon Sep 17 00:00:00 2001 From: Sol Villar Date: Wed, 10 Aug 2016 11:26:14 -0300 Subject: [PATCH 2/2] Modified inclusion of podValidator.php --- modules/open_data_schema_pod/open_data_schema_pod.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/open_data_schema_pod/open_data_schema_pod.module b/modules/open_data_schema_pod/open_data_schema_pod.module index cc31ddd..f177ef5 100644 --- a/modules/open_data_schema_pod/open_data_schema_pod.module +++ b/modules/open_data_schema_pod/open_data_schema_pod.module @@ -4,6 +4,9 @@ * @file * Provides Schema mapping for Project Open Data. */ + +require_once('podValidator.php'); + /** * Implements hook_menu(). */ @@ -390,9 +393,6 @@ function open_data_schema_pod_accrual_iso_8601() { * Validates individual datasets. */ function open_data_schema_pod_process_validate($url, $clear_cache = FALSE) { - if (!class_exists('podValidator\validate')) { - include 'podValidator.php'; - } if (!$clear_cache && $cache = cache_get('pod_validate_result')) { $results = $cache->data; $results['cache_date'] = $cache->created;