[Mapbender-commits] r10355 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 25 05:41:44 PST 2019


Author: armin11
Date: 2019-11-25 05:41:43 -0800 (Mon, 25 Nov 2019)
New Revision: 10355

Modified:
   trunk/mapbender/http/php/mod_dataISOMetadata.php
Log:
Prohibit empty keywords, cause they are not conform to the schemas

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2019-11-22 13:37:00 UTC (rev 10354)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2019-11-25 13:41:43 UTC (rev 10355)
@@ -1063,9 +1063,10 @@
 	$res = db_prep_query($sql,$v,$t);
 	$descriptiveKeywords=$iso19139->createElement("gmd:descriptiveKeywords");
 	$MD_Keywords=$iso19139->createElement("gmd:MD_Keywords");
+        $countNormalKeywords = 0;
 	while ($row = db_fetch_array($res)) {
 		if (isset($row['keyword']) && $row['keyword'] != "") {
-	
+			$countNormalKeywords++;
 			$keyword=$iso19139->createElement("gmd:keyword");
 			$keyword_cs=$iso19139->createElement("gco:CharacterString");
 			$keywordText = $iso19139->createTextNode($row['keyword']);
@@ -1114,8 +1115,10 @@
 	}
 	$e = new mb_notice("count custom categories: ".$countCustom);
 	//close decriptive keywords and generate a new entry for inspire themes:
-	$descriptiveKeywords->appendChild($MD_Keywords);
-	$MD_DataIdentification->appendChild($descriptiveKeywords);
+        if (($countCustom + $countNormalKeywords) > 0) {
+	    $descriptiveKeywords->appendChild($MD_Keywords);
+	    $MD_DataIdentification->appendChild($descriptiveKeywords);
+	}
 	//new entry - with gemet thesaurus referenced
 	$descriptiveKeywords=$iso19139->createElement("gmd:descriptiveKeywords");
 	//****************************************************************************************************************************************************************************************



More information about the Mapbender_commits mailing list