Project

General

Profile

bug #3480

tagged text with square bracket confuses json

Added by Andreas Kohlbecker almost 6 years ago. Updated over 1 year ago.

Status:
New
Priority:
New
Category:
cdmlib-remote
Target version:
-
Start date:
05/15/2013
Due date:
% Done:

0%

Severity:
normal
Found in Version:

Description

symptom reported by a.mueller:

Hi Andreas,

beim Aufruf der Synonymie in Crepis habe ich gerade folgende Warnung bekommen:

Warning: strlen() expects parameter 1 to be string, array given in theme_cdm_taggedtext2html() (line 144 of /var/www/drupal-7.16/sites/dataportal-production/modules/cdm_dataportal/theme/cdmdataportal.common.theme).

http://wp6-cichorieae.e-taxonomy.eu/portal/cdm_dataportal/taxon/d0ae2121-1c32-4737-8c49-f871d429fd90/synonymy

Viele Grüße,

Andreas M.


this happens with the taxon name Hieracioides ["Hieraciodes"] Kuntze

the where the name contains double quoted in square brackets.

The names tagged text contains the following string ["Hieraciodes"] see http://dev.e-taxonomy.eu/cdmserver/cichorieae/name/f41a5447-09c8-4aa6-b894-9e942d83edc3/taggedName.json

JSON is correct in this case:

{

    "appendedPhrase": false,
    "authors": false,
    "class": "TaggedText",
    "fullName": false,
    "hybridSign": false,
    "name": true,
    "nomStatus": false,
    "rank": false,
    "reference": false,
    "separator": false,
    "text": "[\"Hieraciodes\"]",
    "type": "name",
    "year": false

},

but in the synonymy of Crepis http://dev.e-taxonomy.eu/cdmserver/cichorieae/portal/taxon/d0ae2121-1c32-4737-8c49-f871d429fd90/synonymy.json as well as in the following request http://dev.e-taxonomy.eu/cdmserver/cichorieae/portal/name/f41a5447-09c8-4aa6-b894-9e942d83edc3.json it appears like ...

JSON is incorrect in this case:

{

    "appendedPhrase": false,
    "authors": false,
    "class": "TaggedText",
    "fullName": false,
    "hybridSign": false,
    "name": true,
    "nomStatus": false,
    "rank": false,
    "reference": false,
    "separator": false,
    "text": [
        "Hieraciodes"
    ],
    "type": "name",
    "year": false

},

the enclosing quotes are ignored or missed, the square brackets are thus interpreted as a JSON array which lead to the observed error in the dataportal.

This seems to be a bug in the serialization to JSON


Related issues

Related to Edit - task #4009: consider using jackson as json library New 02/09/2015

History

#1 Updated by Andreas Kohlbecker over 1 year ago

  • Description updated (diff)
  • Private changed from Yes to No

#2 Updated by Andreas Kohlbecker over 1 year ago

  • Related to task #4009: consider using jackson as json library added

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)