Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-34

Using PHP library to store json encoded utf-8 values appears to add content as an attachment with no reason

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: library
    • Security Level: Public
    • Labels:
      None
    • Environment:
      php 5.3, 2.0.0 community edition (build-388-gf35126e)

      Description

      when attempting to add a document with the following value:
      {"ent_seq":"1000000","r_ele":[

      {"reb":"\u30fd"}

      ,

      {"reb":"\u304f\u308a\u304b\u3048\u3057"}

      ],"sense":[{"pos":["&n;"],"gloss":[

      {"lang":"en","gend":null,"value":"repetition mark in katakana"}

      ,

      {"lang":"ger","gend":null,"value":"(n) Wiederholung"}

      ,

      {"lang":"ger","gend":null,"value":"Refrain"}

      ]}]}

      Fails. However, adding this string in via the couchbase admin ui works correctly.

      The failure is it adds it as an attachment, not as a document. This breaks the functionality of views. The get method works properly and returns the array data.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        jan Jan Lehnardt (Inactive) added a comment -

        Thanks for the report. I'll be looking into this early next week

        Show
        jan Jan Lehnardt (Inactive) added a comment - Thanks for the report. I'll be looking into this early next week
        Hide
        daschl Michael Nitschinger added a comment -

        Since this bug report has been filed a lot has changed, and I couldn't reproduce this behaviour on the latest 1.1 SDK with a recent CB 2.0 server.

        The following test script works without errors:

        <?php

        $cb = new Couchbase('localhost:8091');

        $string = '{"ent_seq":"1000000","r_ele":[

        {"reb":"\u30fd"}

        ,

        {"reb":"\u304f\u308a\u304b\u3048\u3057"}

        ],"sense":[{"pos":["&n;"],"gloss":[

        {"lang":"en","gend":null,"value":"repetition mark in katakana"}

        ,

        {"lang":"ger","gend":null,"value":"(n) Wiederholung"}

        ,

        {"lang":"ger","gend":null,"value":"Refrain"}

        ]}]}';
        $cb->set('strangekey', $string);

        var_dump($cb->get('strangekey'));
        ?>

        Taylor, is this still an issue for you? I suppose this has been fixed in the latest releases.

        Show
        daschl Michael Nitschinger added a comment - Since this bug report has been filed a lot has changed, and I couldn't reproduce this behaviour on the latest 1.1 SDK with a recent CB 2.0 server. The following test script works without errors: <?php $cb = new Couchbase('localhost:8091'); $string = '{"ent_seq":"1000000","r_ele":[ {"reb":"\u30fd"} , {"reb":"\u304f\u308a\u304b\u3048\u3057"} ],"sense":[{"pos": ["&n;"] ,"gloss":[ {"lang":"en","gend":null,"value":"repetition mark in katakana"} , {"lang":"ger","gend":null,"value":"(n) Wiederholung"} , {"lang":"ger","gend":null,"value":"Refrain"} ]}]}'; $cb->set('strangekey', $string); var_dump($cb->get('strangekey')); ?> Taylor, is this still an issue for you? I suppose this has been fixed in the latest releases.
        Hide
        ingenthr Matt Ingenthron added a comment -

        appears to be fixed

        Show
        ingenthr Matt Ingenthron added a comment - appears to be fixed

          People

          • Assignee:
            ingenthr Matt Ingenthron
            Reporter:
            tdondich Taylor Dondich
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes