Project

General

Profile

Actions

bug #3480

open

task #6992: Refactor and modernize REST web service API

tagged text with square bracket confuses json

Added by Andreas Kohlbecker almost 11 years ago. Updated about 2 years ago.

Status:
New
Priority:
New
Category:
cdmlib-remote
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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/cdm_dataportal.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 libraryNewAndreas Müller

Actions
Actions #1

Updated by Andreas Kohlbecker over 6 years ago

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

Updated by Andreas Kohlbecker over 6 years ago

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

Updated by Andreas Müller over 3 years ago

  • Target version set to cdmlib-remote cleanup

target version is missing. I put it to same milestone as related ticket. Please change if this is wrong.

Actions #4

Updated by Andreas Müller about 2 years ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller
  • Parent task set to #6992
Actions

Also available in: Atom PDF