Project

General

Profile

Actions

Backport(バックポート) #2125

closed

[api] /mediaitems/@me/@self/{albumId} で取得できるコレクションの albumId フィールドの値が間違っている

Added by Youichi Kimura over 13 years ago. Updated over 13 years ago.

Status:
Fixed(完了)
Priority:
Normal(通常)
Assignee:
-
Target version:
Start date:
2011-05-10
Due date:
% Done:

100%

Estimated time:

Description

Overview (現象)

/mediaitems/@me/@self/{albumId} でアルバムに含まれるMediaItemのコレクションを取得すると、下記のように albumId フィールドがMediaItemのidの値になってしまう。

{
    "entry": [
        {
            "albumId": "1", 
            "created": "2011-05-10 17:57:37", 
            "description": "0f7d8518b483d10f86a6d90edeb97979fd0af43a_png", 
            "fileSize": "0", 
            "id": "1", 
            "lastUpdated": "2011-05-10 17:57:37", 
            "thumbnailUrl": "http://sns.localhost/sqlite/cache/img/png/w180_h180/a_1_0f7d8518b483d10f86a6d90edeb97979fd0af43a_png.png", 
            "title": "0f7d8518b483d10f86a6d90edeb97979fd0af43a_png", 
            "type": "IMAGE", 
            "url": "http://sns.localhost/sqlite/cache/img/png/w_h/a_1_0f7d8518b483d10f86a6d90edeb97979fd0af43a_png.png" 
        }, 
        {
            "albumId": "2", 
            "created": "2011-05-10 17:57:38", 
            "description": "c51bc5e4eb6eec85258f088f9900c0f059d9c394_png", 
            "fileSize": "0", 
            "id": "2", 
            "lastUpdated": "2011-05-10 17:57:38", 
            "thumbnailUrl": "http://sns.localhost/sqlite/cache/img/png/w180_h180/a_1_c51bc5e4eb6eec85258f088f9900c0f059d9c394_png.png", 
            "title": "c51bc5e4eb6eec85258f088f9900c0f059d9c394_png", 
            "type": "IMAGE", 
            "url": "http://sns.localhost/sqlite/cache/img/png/w_h/a_1_c51bc5e4eb6eec85258f088f9900c0f059d9c394_png.png" 
        }
    ], 
    "itemsPerPage": 10, 
    "startIndex": 0, 
    "totalResults": 2
}

Causes (原因)

lib/util/opJsonDbOpensocialService.class.php にて、下記のように albumId にalbum_imageテーブルのidの値を入れている箇所があるため。

foreach ($objects as $object)
{
  $result['albumId']      = $object->getId();
  $result['created']      = $object->getCreatedAt();
  $result['description']  = opOpenSocialToolKit::convertEmojiForApi($object->getDescription());
  $result['fileSize']     = $object->getFilesize();
  $result['id']           = $object->getId();
  $result['lastUpdated']  = $object->getUpdatedAt();
  $result['thumbnailUrl'] = '';

Way to fix (修正内容)

$result['albumId'] にalbum_imageテーブルの album_id の値を入れるように修正する。


Related issues 1 (0 open1 closed)

Related to opOpenSocialPlugin - Bug(バグ) #2072: [api] /mediaitems/@me/@self/{albumId} で取得できるコレクションの albumId フィールドの値が間違っているFixed(完了)Youichi Kimura2011-05-10

Actions
Actions #1

Updated by Shogo Kawahara over 13 years ago

  • Target version changed from 1.3.2 to 0.9.11
Actions #2

Updated by Shogo Kawahara over 13 years ago

  • Status changed from Pending Fixing(修正待ち) to Pending Review(レビュー待ち)
  • % Done changed from 100 to 50

更新履歴 b9d6b5ac29bd06f1206829382ef3c3ca1410f3e7 で適用されました。

Actions #3

Updated by Shogo Kawahara over 13 years ago

  • Status changed from Pending Review(レビュー待ち) to Fixed(完了)
  • % Done changed from 50 to 100
Actions

Also available in: Atom PDF