Skip to content

Commit

Permalink
Hotfix 2023 07 31 (#565)
Browse files Browse the repository at this point in the history
* Hotfix 2023 06 19 (#518)

* Taxonomy Harvesting minor adjustments

- Check resources before interpretation and again after interpretation
- If name is matched within one recourse, skip the unnecessary step to check other resources
- Synchronize display text

* Refactor ImageLocalProcessor and resolve various bugs

- Provide support for input file to include medium and thumbnail image derivatives
- Expand Image Map processing to allow mapping file to include any images table field name
- Expand images insert function to handle any valid field found within images table
- Merge duplicate actions into shared private functions
- MD5 hash large version of image input file, but don't overwrite hash if supplied by source, unless image is not modified by upload scripts
- Handle BOM characters at start of csv file.
- Trim header elements for testing column names.
- Enforce default action of accepting derivative urls supplied within a csv image map file
- Improve uriExists function
- Make sure to remove staging images

* Occurrence Public Display page

- Allow occurrence archive (deleted occurrences) to be searchable by GUID (occurrenceID, recordID), thus reporting when a record is deleted

* Checklist multi-polygon map Issue

- Multipolygons defined within a checklist fail to map within both simple and dynamic maps

* Suppress geo ref index during stats update

* Occurrence Reviewer bug

- Fix for field name and start and end date filter variables failing to be carried forward when advancing to pages beyond 1000 records
#335

* Collection metadata editor bug

- Reset contact array to ensure that JSON string is standardized as a non-associated array
Resolves issue: #487

---------

Co-authored-by: Greg Post <[email protected]>

* Hotfix 2023 07 22 (#559)

* Hotfix - 2023-07-22
- DwcArchivePublishing: Material Sample  publishing bug
- DwC-A upload: Scientific name failed to be built when taxonomic data is supplied by by individual components 
- Taxonomic autocomplete: Allow autocomplete handle apostrophes
- Checklist Display: Bug fix that interfered with display of linked voucher images
- Checklist Manager: Checklist taxon search autocomplete failed to include higher taxa (parent data)
- Taxonomy Harvester bug: F-dex harvest failed to grab parents when source was not "Index Fungorum"
- Specimen Upload: Set version data changes as the default action only when a collection is live managed
- Occurrence Search Harvest: Reworked search form validation to be more efficient; Fix bug with occurrence attribute checkbox/radio failing to be recognized as a selected component

* Hotfix 2023-06-19 (#518)
- Taxonomy Harvesting: Don't check following taxonomic resource on a positive match and input; synchronize display text
- Refactor ImageLocalProcessor: 
-- Provide support for input file to include medium and thumbnail image derivatives
-- Expand Image Map processing to allow mapping file to include any images table field name
-- Expand images insert function to handle any valid field found within images table
-- MD5 hash large version of image input file, but don't overwrite hash if supplied by source
-- Handle BOM characters at start of csv file.
-- Trim header elements for testing column names.
-- Enforce default action of accepting derivative urls supplied within a csv image map file
-- Make sure to remove staging images
- Occurrence Public Display: Allow occurrence archive (deleted occurrences) to be searchable by GUID (occurrenceID, recordID), thus reporting when a record is deleted
- Checklist multi-polygon Map: resolve Multipolygons failing to map within both simple and dynamic maps
- Occurrence Reviewer: Fix for field name and start and end date filter variables failing to be carried forward when advancing to pages beyond 1000 records
- Collection metadata editor: Reset contact array to ensure that JSON string is standardized as a non-associated array

---------

Co-authored-by: Greg Post <[email protected]>

* Occurrence Search bug

- Fix issue with autocomplete failing to return names that contain single or double quotes
- Fix issue taxon name search failing to return correct data when name contains single or double quotes

* Glossary search bug

- Allow terms search to do a double wildcard search to expand return options, including when html tags (e.g. italic) are part of the terms
- Remove restrictions and unnecessary default actions associated with unset language and taxon terms so that thesaurus better functions as a single language glossaries
- Fix various issues with export of report when there is a single language glossary and/or terms are not linked to specific taxa
- Fix various misc bugs

* Glossary adjustments

- minor styling adjustment

* Taxonomy Utilities bug

- Fix issue interfering import of taxa with hybrid symbol when there is not a space between symbol and name units

* Glossary development

- Fix issue report export not including full list when terms has complex language relationships
- Improve file naming and content/layout of Word report export
- Resolve issues with inclusion of all Spanish language translation files
- Include translations for some missed terms

* Hotfix 2023-07-31

- Occurrence editor: bug not nulling year, month, day when date is nulled out
- Glossary: extend wildcard search on search terms
- Update code version

* Taxonomy Harvesting bug

- Resolve 'Unranked" taxonRank designations when taxon is a non-accepted genus

* Taxonomy Upload adjustments

- Minor adjustments needed to support processing of taxa immediately adjacent to kingdom rank

* hotfix 2023-07-31

- occurrence editor: allow tidInterpreted value to be transferred when scientific name is added to form via duplicate tool

* hotfix 2023-07-31

- Map Search: resolved issue where map recenters in the middle of the ocean when a search returns no coordinates

---------

Co-authored-by: Greg Post <[email protected]>
  • Loading branch information
egbot and GregoryPost authored Aug 4, 2023
1 parent c1f3bd8 commit faa20d4
Show file tree
Hide file tree
Showing 19 changed files with 342 additions and 348 deletions.
260 changes: 131 additions & 129 deletions classes/GlossaryManager.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion classes/OccurrenceTaxaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ protected function cleanInputStr($str){
$str = trim($str,' ,;');
if($str == '%') $str = '';
$str = strip_tags($str);
$str = htmlspecialchars($str, HTML_SPECIAL_CHARS_FLAGS);
$str = htmlspecialchars($str, ENT_NOQUOTES | ENT_SUBSTITUTE | ENT_HTML401);
return $str;
}

Expand Down
5 changes: 3 additions & 2 deletions classes/TaxonSearchSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ private function getTaxaSuggestByRank(){
//Setters and getters
public function setQueryString($queryString){
//$queryString = $this->cleanInStr($queryString);
$queryString = preg_replace('/[\'"+\=@$%]+/i', '', $queryString);
$queryString = preg_replace('/[\+\=@$%]+/i', '', $queryString);
if(strpos($queryString, ' ')){
$queryString = str_ireplace(array('"', "'"), '_', $queryString);
$queryString = preg_replace('/\s{1}x{1}$/i', ' _', $queryString);
$queryString = preg_replace('/\s{1}x{1}\s{1}/i', ' _ ', $queryString);
$queryString = str_ireplace(' x', ' _', $queryString);
$queryString = str_ireplace(' x ', ' _ ', $queryString);
$queryString = str_ireplace(' x', ' _', $queryString);
}
$this->queryString = $queryString;
}
Expand Down
3 changes: 3 additions & 0 deletions classes/TaxonomyHarvester.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ private function translateColNode($nodeArr){
elseif(isset($nodeArr['name']['scientificName'])) $taxonArr['sciname'] = $nodeArr['name']['scientificName'];
if(isset($nodeArr['rank'])) $taxonArr['taxonRank'] = $nodeArr['rank'];
elseif(isset($nodeArr['name']['rank'])) $taxonArr['taxonRank'] = $nodeArr['name']['rank'];
if($taxonArr['taxonRank'] == 'Unranked'){
if(isset($nodeArr['accepted_name']['rank'])) $taxonArr['taxonRank'] = $nodeArr['accepted_name']['rank'];
}
if(isset($nodeArr['genus'])) $taxonArr['unitname1'] = $nodeArr['genus'];
elseif(isset($nodeArr['name']['genus'])) $taxonArr['unitname1'] = $nodeArr['name']['genus'];
elseif(isset($nodeArr['name']['uninomial'])) $taxonArr['unitname1'] = $nodeArr['name']['uninomial'];
Expand Down
17 changes: 10 additions & 7 deletions classes/TaxonomyUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,13 @@ public function cleanUpload(){

$sql = 'UPDATE uploadtaxa u INNER JOIN uploadtaxa u2 ON u.sourceParentId = u2.sourceId '.
'SET u.parentstr = u2.sciname '.
'WHERE (u.parentstr IS NULL) AND (u.sourceParentId IS NOT NULL) AND (u2.sourceId IS NOT NULL)';
'WHERE (u.parentstr IS NULL)';
if(!$this->conn->query($sql)){
$this->outputMsg('ERROR: '.$this->conn->error,1);
}
$sql = 'UPDATE uploadtaxa u INNER JOIN uploadtaxa u2 ON u.sourceAcceptedId = u2.sourceId '.
'SET u.acceptedstr = u2.sciname '.
'WHERE (u.acceptedstr IS NULL) AND (u.sourceAcceptedId IS NOT NULL) AND (u2.sourceId IS NOT NULL)';
'WHERE (u.acceptedstr IS NULL)';
if(!$this->conn->query($sql)){
$this->outputMsg('ERROR: '.$this->conn->error,1);
}
Expand All @@ -452,7 +452,8 @@ public function cleanUpload(){

//Link names already in theusaurus
$this->outputMsg('Linking names already in thesaurus... ');
$sql = 'UPDATE uploadtaxa u INNER JOIN taxa t ON u.sciname = t.sciname SET u.tid = t.tid WHERE (u.tid IS NULL) AND (t.kingdomname = "'.$this->kingdomName.'") ';
$sql = 'UPDATE uploadtaxa u INNER JOIN taxa t ON u.sciname = t.sciname SET u.tid = t.tid
WHERE (u.tid IS NULL) AND (t.kingdomname = "'.$this->kingdomName.'" OR t.sciname = "'.$this->kingdomName.'" OR t.rankid < 10) ';
if(!$this->conn->query($sql)){
$this->outputMsg('ERROR: '.$this->conn->error,1);
}
Expand All @@ -465,7 +466,7 @@ public function cleanUpload(){
}
$sql = 'UPDATE uploadtaxa u INNER JOIN taxa t ON u.acceptedstr = t.sciname '.
'SET u.tidaccepted = t.tid '.
'WHERE (u.tidaccepted IS NULL) AND (t.kingdomname = "'.$this->kingdomName.'")';
'WHERE (u.tidaccepted IS NULL) AND (t.kingdomname = "'.$this->kingdomName.'" OR t.sciname = "'.$this->kingdomName.'" OR t.rankid < 10)';
if(!$this->conn->query($sql)){
$this->outputMsg('ERROR: '.$this->conn->error,1);
}
Expand Down Expand Up @@ -570,7 +571,9 @@ public function cleanUpload(){
$this->outputMsg('ERROR: '.$this->conn->error,1);
}

$sql = 'UPDATE uploadtaxa up INNER JOIN taxa t ON up.parentstr = t.sciname SET parenttid = t.tid WHERE (parenttid IS NULL) AND (t.kingdomname = "'.$this->kingdomName.'")';
$sql = 'UPDATE uploadtaxa up INNER JOIN taxa t ON up.parentstr = t.sciname
SET parenttid = t.tid
WHERE (parenttid IS NULL) AND (t.kingdomname = "'.$this->kingdomName.'" OR t.sciname = "'.$this->kingdomName.'" OR t.rankid < 10)';
if(!$this->conn->query($sql)){
$this->outputMsg('ERROR: '.$this->conn->error,1);
}
Expand All @@ -584,7 +587,7 @@ public function cleanUpload(){
$this->conn->query($sql);
$sql = 'UPDATE uploadtaxa up INNER JOIN taxa t ON up.parentstr = t.sciname '.
'SET up.parenttid = t.tid '.
'WHERE (up.parenttid IS NULL) AND (t.kingdomname = "'.$this->kingdomName.'")';
'WHERE (up.parenttid IS NULL) AND (t.kingdomname = "'.$this->kingdomName.'" OR t.sciname = "'.$this->kingdomName.'" OR t.rankid < 10)';
$this->conn->query($sql);

//Load into uploadtaxa parents of species not yet in taxa table
Expand All @@ -595,7 +598,7 @@ public function cleanUpload(){
$this->conn->query($sql);
$sql = 'UPDATE uploadtaxa up LEFT JOIN taxa t ON up.parentstr = t.sciname '.
'SET up.parenttid = t.tid '.
'WHERE ISNULL(up.parenttid) AND (t.kingdomname = "'.$this->kingdomName.'")';
'WHERE ISNULL(up.parenttid) AND (t.kingdomname = "'.$this->kingdomName.'" OR t.sciname = "'.$this->kingdomName.'" OR t.rankid < 10)';
$this->conn->query($sql);

//Set acceptance to 0 where sciname <> acceptedstr
Expand Down
16 changes: 13 additions & 3 deletions classes/TaxonomyUtilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ public static function parseScientificName($inStr, $conn = null, $rankId = 0, $k
$okToCloseConn = true;
if($conn !== null) $okToCloseConn = false;
if(count($sciNameArr)){
if(strtolower($sciNameArr[0]) == 'x' || $sciNameArr[0] == '×' || mb_ord($sciNameArr[0]) == 215){
if(strtolower($sciNameArr[0]) == 'x' || $sciNameArr[0] == '×'){
$retArr['unitind1'] = array_shift($sciNameArr);
}
elseif(mb_ord($sciNameArr[0]) == 215){
$retArr['unitind1'] = '×';
$unitStr = substr(array_shift($sciNameArr), 2);
if($unitStr) array_unshift($sciNameArr, $unitStr);
}
elseif($sciNameArr[0] == '' || mb_ord($sciNameArr[0]) == 8224){
$retArr['unitind1'] = array_shift($sciNameArr);
}
Expand All @@ -59,11 +64,16 @@ public static function parseScientificName($inStr, $conn = null, $rankId = 0, $k
//Genus
$retArr['unitname1'] = ucfirst(strtolower(array_shift($sciNameArr)));
if(count($sciNameArr)){
if(strtolower($sciNameArr[0]) == 'x' || mb_ord($sciNameArr[0]) == 215){
//Species level hybrid
if(strtolower($sciNameArr[0]) == 'x' || $sciNameArr[0] == '×'){
$retArr['unitind2'] = array_shift($sciNameArr);
$retArr['unitname2'] = array_shift($sciNameArr);
}
elseif(mb_ord($sciNameArr[0]) == 215){
$retArr['unitind2'] = '×';
$unitStr = substr(array_shift($sciNameArr), 2);
if($unitStr) $retArr['unitname2'] = $unitStr;
else $retArr['unitname2'] = array_shift($sciNameArr);
}
elseif(strpos($sciNameArr[0],'.') !== false){
//It is assumed that Author has been reached, thus stop process
$retArr['author'] = implode(' ',$sciNameArr);
Expand Down
5 changes: 2 additions & 3 deletions collections/editor/dupesearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
//Matching event, thus limit output
unset($tempOcc['family']);
unset($tempOcc['sciname']);
unset($tempOcc['tid']);
unset($tempOcc['tidinterpreted']);
unset($tempOcc['scientificnameauthorship']);
unset($tempOcc['taxonremarks']);
unset($tempOcc['identifiedby']);
Expand All @@ -98,12 +98,11 @@ function transferRecord(occId,appendMode){
var openerForm = opener.document.fullform;
if(document.getElementById("linkdupe-"+occId).checked == true){
openerForm.linkdupe.value = occId;

}
for(var k in tArr){
try{
var elem = openerForm.elements[k];
if(elem.disabled == false && elem.type != 'hidden' && (appendMode == false || elem.value == "")){
if(elem.disabled == false && (elem.type != 'hidden' || k == "tidinterpreted") && (appendMode == false || elem.value == "")){
elem.value = tArr[k];
elem.style.backgroundColor = "lightblue";
if(k != "tid") opener.fieldChanged(k);
Expand Down
2 changes: 1 addition & 1 deletion collections/editor/occurrenceeditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ function requestImage(){
<script src="../../js/symb/collections.coordinateValidation.js?ver=2" type="text/javascript"></script>
<script src="../../js/symb/wktpolygontools.js?ver=2" type="text/javascript"></script>
<script src="../../js/symb/collections.georef.js?ver=2" type="text/javascript"></script>
<script src="../../js/symb/collections.editor.main.js?ver=3" type="text/javascript"></script>
<script src="../../js/symb/collections.editor.main.js?ver=4" type="text/javascript"></script>
<script src="../../js/symb/collections.editor.tools.js?ver=4" type="text/javascript"></script>
<script src="../../js/symb/collections.editor.imgtools.js?ver=3" type="text/javascript"></script>
<script src="../../js/jquery.imagetool-1.7.js?ver=140310" type="text/javascript"></script>
Expand Down
2 changes: 1 addition & 1 deletion collections/map/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ function afterEffects(){
buildCollKey();
buildTaxaKey();
jscolor.init();
if(pointBounds){
if(!pointBounds.isEmpty){
map.fitBounds(pointBounds);
map.panToBounds(pointBounds);
}
Expand Down
2 changes: 1 addition & 1 deletion config/symbbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
header('X-Frame-Options: DENY');
header('Cache-control: private'); // IE 6 FIX
date_default_timezone_set('America/Phoenix');
$CODE_VERSION = '3.0.11';
$CODE_VERSION = '3.0.12';

if(!isset($CLIENT_ROOT) && isset($clientRoot)) $CLIENT_ROOT = $clientRoot;
if(substr($CLIENT_ROOT,-1) == '/') $CLIENT_ROOT = substr($CLIENT_ROOT,0,strlen($CLIENT_ROOT)-1);
Expand Down
11 changes: 6 additions & 5 deletions content/lang/glossary/index.en.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

include_once($SERVER_ROOT.'/content/lang/glossary/addterm.en.php');

$LANG['PLEASE_REFINE'] = 'Please select a language and taxonomic group to see term list.';
$LANG['PLEASE_TO_DWNLD'] = 'Please select a primary language and taxonomic group to download.';
$LANG['PLEASE_TRANSL'] = 'Please select a maximum of three translations for the Translation Table. Please be sure to not select the primary language.';
$LANG['PLEASE_ONE'] = 'Please select at least one translation for the Translation Table. Please be sure to not select the primary language.';
$LANG['HOME'] = 'Home';
Expand All @@ -26,9 +24,12 @@
$LANG['SEARCH_TERM'] = 'Search Term';
$LANG['SEARCH_DEF'] = 'Search within definitions';
$LANG['SEARCH_TERMS'] = 'Search/Browse Terms';
$LANG['NO_GLOSS'] = 'A glossary has not yet been established for this portal';
$LANG['DISP_SRC'] = '(Display Sources)';
$LANG['ADD_SRC'] = '(Add Sources)';
$LANG['TERMS'] = 'Terms';
$LANG['FOR'] = 'for';
$LANG['IN'] = 'in';
$LANG['KEYWORD'] = 'with keyword ';
$LANG['DISP_SRC'] = 'Display Sources';
$LANG['ADD_SRC'] = 'Add Sources';
$LANG['TAX_CONTR'] = 'Contributors for Taxonomic Group';
$LANG['TERM_CONTR'] = 'Terms and Definitions contributed by';
$LANG['IMG_CONTR'] = 'Images contributed by';
Expand Down
13 changes: 7 additions & 6 deletions content/lang/glossary/index.es.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
------------------
*/

include_once($SERVER_ROOT.'/content/lang/glossary/addterm.en.php');
include_once($SERVER_ROOT.'/content/lang/glossary/addterm.es.php');

$LANG['PLEASE_REFINE'] = 'Por favor seleccione el idioma y grupo taxonómico para ver el listado de términos.';
$LANG['PLEASE_TO_DWNLD'] = 'Por favor seleccione un idioma primario y un grupo taxonómico para descargar.';
$LANG['PLEASE_TRANSL'] = 'Por favor seleccione un máximo de traducciones para la Tabla de Traducciones. Por favor asegúrese de no seleccionar el idioma primario.';
$LANG['PLEASE_ONE'] = 'Por favor seleccione al menos una traducción para la Tabla de Traducciones. Por favor asegúrese de no seleccionar el idioma primario.';
$LANG['HOME'] = 'Inicio';
Expand All @@ -26,9 +24,12 @@
$LANG['SEARCH_TERM'] = 'Término de Búsqueda';
$LANG['SEARCH_DEF'] = 'Buscar entre las definiciones';
$LANG['SEARCH_TERMS'] = 'Buscar/Explorar Términos';
$LANG['NO_GLOSS'] = 'Un glosario aún no ha sido establecido para este portal';
$LANG['DISP_SRC'] = '(Desplegar Fuentes)';
$LANG['ADD_SRC'] = '(Añadir Fuentes)';
$LANG['TERMS'] = 'Términos';
$LANG['FOR'] = 'para';
$LANG['IN'] = 'en';
$LANG['KEYWORD'] = 'con palabra clave';
$LANG['DISP_SRC'] = 'Desplegar Fuentes';
$LANG['ADD_SRC'] = 'Añadir Fuentes';
$LANG['TAX_CONTR'] = 'Contribuyentes para Grupo Taxonómico';
$LANG['TERM_CONTR'] = 'Términos y Definiciones contribuídas por';
$LANG['IMG_CONTR'] = 'Imágenes contribuídas por';
Expand Down
2 changes: 1 addition & 1 deletion content/lang/glossary/individual.es.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
------------------
*/

include_once($SERVER_ROOT.'/content/lang/glossary/index.en.php');
include_once($SERVER_ROOT.'/content/lang/glossary/index.es.php');

$LANG['GLOSS_TERM_INFO'] = 'Información de Términos del Glosario';
$LANG['LOADING'] = 'Descargando';
Expand Down
2 changes: 1 addition & 1 deletion content/lang/glossary/sources.es.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
------------------
*/

include_once($SERVER_ROOT.'/content/lang/glossary/index.en.php');
include_once($SERVER_ROOT.'/content/lang/glossary/index.es.php');

$LANG['G_SOURCES'] = 'Manejo de Fuentes del Glosario';
$LANG['MAIN_G'] = 'Glosario Principal';
Expand Down
2 changes: 1 addition & 1 deletion content/lang/glossary/termdetails.es.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
------------------
*/

include_once($SERVER_ROOT.'/content/lang/glossary/addterm.en.php');
include_once($SERVER_ROOT.'/content/lang/glossary/addterm.es.php');

$LANG['G_MGMNT'] = 'Administración de Glosario';
$LANG['LOAD'] = 'Cargando';
Expand Down
Loading

0 comments on commit faa20d4

Please sign in to comment.