]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
GNU Social extensions fixes (please read note)
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 21 Aug 2013 12:12:18 +0000 (14:12 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 21 Aug 2013 12:33:07 +0000 (14:33 +0200)
These extensions are not considered secure nor stable right now, so don't
use them for a while.

plugins/GNUsocialPhotos/classes/gnusocialphoto.php
plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php
plugins/GNUsocialProfileExtensions/classes/GNUsocialProfileExtensionField.php
plugins/GNUsocialProfileExtensions/classes/GNUsocialProfileExtensionResponse.php

index 6e9daac2ed8704c1ae2e82ba8a380059134ea190..9fbe5a58aa4282b2adac8680e0f9cb0a235c6dbe 100644 (file)
@@ -60,7 +60,7 @@ class GNUsocialPhoto extends Managed_DataObject
     {
         return array(
             'fields' => array(
-                'id' => array('type' => 'int', 'not null' => true, 'description' => 'Unique ID for Photo'),
+                'id' => array('type' => 'serial', 'not null' => true, 'description' => 'Unique ID for Photo'),
                 'notice_id' => array('type' => 'int', 'not null' => true, 'description' => 'Notice ID for the related notice'),
                 'album_id' => array('type' => 'int', 'not null' => true, 'description' => 'The parent album ID'),
                 'uri' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'unique address for this photo'),
@@ -72,7 +72,8 @@ class GNUsocialPhoto extends Managed_DataObject
             ),
             'primary key' => array('id'),
             'unique keys' => array(
-                'gnusocialphoto_uri' => array('uri'),
+                'gnusocialphoto_id_key' => array('notice_id'),
+                'gnusocialphoto_uri_key' => array('uri'),
             ),
             'foreign keys' => array(
                 'gnusocialphoto_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
index 208c341851d013a48271641175c1e8cbb9640a7f..8b8c1dbf5a03c7b98e813deb0c1fe924b1edbaf2 100644 (file)
@@ -48,7 +48,7 @@ class GNUsocialPhotoAlbum extends Managed_DataObject
     {
         return array(
             'fields' => array(
-                'album_id' => array('type' => 'int', 'not null' => true, 'description' => 'Unique identifier for the album'),
+                'album_id' => array('type' => 'serial', 'not null' => true, 'description' => 'Unique identifier for the album'),
                 'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'Profile ID for the owner of the album'),
                 'album_name' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'Title for this album'),
                 'album_description' => array('type' => 'text', 'not null' => true, 'description' => 'A description for this album'),
index 9574863c58be63d601823c09d8a9c0707c275230..564ddce875e40294de0fad6411fb5f2310c616e0 100644 (file)
@@ -34,7 +34,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
 
 class GNUsocialProfileExtensionField extends Managed_DataObject
 {
-    public $__table = 'GNUsocialProfileExtensionField';
+    public $__table = 'gnusocialprofileextensionfield';
     public $id;          // int(11)
     public $systemname;  // varchar(64)
     public $title;       // varchar(255)
@@ -47,7 +47,7 @@ class GNUsocialProfileExtensionField extends Managed_DataObject
     {
         return array(
             'fields' => array(
-                'id' => array('type' => 'int', 'not null' => true, 'description' => 'Unique ID for extension field'),
+                'id' => array('type' => 'serial', 'not null' => true, 'description' => 'Unique ID for extension field'),
                 'systemname' => array('type' => 'varchar', 'not null' => true, 'length' => 64, 'description' => 'field systemname'),
                 'title' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'field title'),
                 'description' => array('type' => 'text', 'not null' => true, 'description' => 'field description'),
@@ -62,16 +62,6 @@ class GNUsocialProfileExtensionField extends Managed_DataObject
         );
     }
 
-    function keyTypes()
-    {
-        return array('id' => 'K');
-    }
-
-    function sequenceKey()
-    {
-        return array(false, false, false);
-    }
-
     static function newField($title, $description=null, $type='str', $systemname=null)
     {
         $field = new GNUsocialProfileExtensionField();
index 4163d4d07707b5bcaf8593ab035645a9ab4b5203..7af6bb5051c396a55c1232734773ce72b5fa1348 100644 (file)
@@ -34,7 +34,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
 
 class GNUsocialProfileExtensionResponse extends Managed_DataObject
 {
-    public $__table = 'GNUsocialProfileExtensionResponse';
+    public $__table = 'gnusocialprofileextensionresponse';
     public $id;           // int(11)
     public $extension_id; // int(11)
     public $profile_id;   // int(11)
@@ -46,7 +46,7 @@ class GNUsocialProfileExtensionResponse extends Managed_DataObject
     {
         return array(
             'fields' => array(
-                'id' => array('type' => 'int', 'not null' => true, 'description' => 'Unique ID for extension response'),
+                'id' => array('type' => 'serial', 'not null' => true, 'description' => 'Unique ID for extension response'),
                 'extension_id' => array('type' => 'int', 'not null' => true, 'description' => 'The extension field ID'),
                 'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'Profile id that made the response'),
                 'value' => array('type' => 'text', 'not null' => true, 'description' => 'response entry'),
@@ -56,7 +56,7 @@ class GNUsocialProfileExtensionResponse extends Managed_DataObject
             'primary key' => array('id'),
             'foreign keys' => array(
                 'gnusocialprofileextensionresponse_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
-                'gnusocialprofileextensionresponse_extension_id_fkey' => array('GNUsocialProfileExtensionField', array('extension_id' => 'id')),
+                'gnusocialprofileextensionresponse_extension_id_fkey' => array('gnusocialprofileextensionfield', array('extension_id' => 'id')),
             ),
             'indexes' => array(
                 'gnusocialprofileextensionresponse_extension_id_idx' => array('extension_id'),
@@ -82,8 +82,8 @@ class GNUsocialProfileExtensionResponse extends Managed_DataObject
 
     static function findResponsesByProfile($id)
     {
-        $extf = 'GNUsocialProfileExtensionField';
-        $extr = 'GNUsocialProfileExtensionResponse';
+        $extf = 'gnusocialprofileextensionfield';
+        $extr = 'gnusocialprofileextensionresponse';
         $sql = "SELECT $extr.*, $extf.title, $extf.description, $extf.type, $extf.systemname FROM $extr JOIN $extf ON $extr.extension_id=$extf.id WHERE $extr.profile_id = $id";
         $response = new GNUsocialProfileExtensionResponse();
         $response->query($sql);