aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-12 01:21:08 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-12 01:21:08 +0000
commitc6299905a4f25b763fc2469b1a59e6405dee11a8 (patch)
treef4640e7537a2003a10706086c1d5718379369655 /engine
parent739ba4e2e92c62ebb768cf49b7eedd464014d616 (diff)
downloadelgg-c6299905a4f25b763fc2469b1a59e6405dee11a8.tar.gz
elgg-c6299905a4f25b763fc2469b1a59e6405dee11a8.tar.bz2
fixes #1329 - schema for river is fixed - was incomplete before
git-svn-id: http://code.elgg.org/elgg/trunk@3667 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/river2.php27
-rw-r--r--engine/schema/mysql.sql2
-rw-r--r--engine/schema/upgrades/2009091901.sql3
3 files changed, 20 insertions, 12 deletions
diff --git a/engine/lib/river2.php b/engine/lib/river2.php
index 799af013c..09a6b0cc7 100644
--- a/engine/lib/river2.php
+++ b/engine/lib/river2.php
@@ -57,8 +57,8 @@ function add_to_river($view,$action_type,$subject_guid,$object_guid,$access_id =
" view = '{$view}', " .
" subject_guid = {$subject_guid}, " .
" object_guid = {$object_guid}, " .
- " posted = {$posted}, " .
- " annotation_id = {$annotation_id} ");
+ " annotation_id = {$annotation_id}, " .
+ " posted = {$posted} ");
}
/**
@@ -119,7 +119,9 @@ function update_river_access_by_object($object_guid, $access_id) {
*
* @param int|array $subject_guid Acting entity to restrict to. Default: all
* @param int|array $object_guid Entity being acted on to restrict to. Default: all
- * @param string $subject_relationship If set to a relationship type, this will use $subject_guid as the starting point and set the subjects to be all users this entity has this relationship with (eg 'friend'). Default: blank
+ * @param string $subject_relationship If set to a relationship type, this will use
+ * $subject_guid as the starting point and set the subjects to be all users this
+ * entity has this relationship with (eg 'friend'). Default: blank
* @param string $type The type of entity to restrict to. Default: all
* @param string $subtype The subtype of entity to restrict to. Default: all
* @param string $action_type The type of river action to restrict to. Default: all
@@ -215,7 +217,8 @@ function get_river_items($subject_guid = 0, $object_guid = 0, $subject_relations
$whereclause = implode(' and ', $where);
// Construct main SQL
- $sql = "select id,type,subtype,action_type,access_id,view,subject_guid,object_guid,posted,annotation_id from {$CONFIG->dbprefix}river where {$whereclause} order by posted desc limit {$offset},{$limit}";
+ $sql = "select id,type,subtype,action_type,access_id,view,subject_guid,object_guid,annotation_id,posted" .
+ " from {$CONFIG->dbprefix}river where {$whereclause} order by posted desc limit {$offset},{$limit}";
// Get data
return get_data($sql);
@@ -254,7 +257,9 @@ function elgg_view_river_item($item) {
*
* @param int|array $subject_guid Acting entity to restrict to. Default: all
* @param int|array $object_guid Entity being acted on to restrict to. Default: all
- * @param string $subject_relationship If set to a relationship type, this will use $subject_guid as the starting point and set the subjects to be all users this entity has this relationship with (eg 'friend'). Default: blank
+ * @param string $subject_relationship If set to a relationship type, this will use
+ * $subject_guid as the starting point and set the subjects to be all users this
+ * entity has this relationship with (eg 'friend'). Default: blank
* @param string $type The type of entity to restrict to. Default: all
* @param string $subtype The subtype of entity to restrict to. Default: all
* @param string $action_type The type of river action to restrict to. Default: all
@@ -272,12 +277,12 @@ function elgg_view_river_items($subject_guid = 0, $object_guid = 0, $subject_rel
// Get river items, if they exist
if ($riveritems = get_river_items($subject_guid,$object_guid,$subject_relationship,$type,$subtype,$action_type,($limit + 1),$offset,$posted_min,$posted_max)) {
- return elgg_view('river/item/list',array(
- 'limit' => $limit,
- 'offset' => $offset,
- 'items' => $riveritems,
- 'pagination' => $pagination
- ));
+ return elgg_view('river/item/list',array(
+ 'limit' => $limit,
+ 'offset' => $offset,
+ 'items' => $riveritems,
+ 'pagination' => $pagination
+ ));
}
diff --git a/engine/schema/mysql.sql b/engine/schema/mysql.sql
index ce6e7b7a1..dd5d43592 100644
--- a/engine/schema/mysql.sql
+++ b/engine/schema/mysql.sql
@@ -357,6 +357,7 @@ CREATE TABLE `prefix_system_log` (
`view` TEXT NOT NULL ,
`subject_guid` INT NOT NULL ,
`object_guid` INT NOT NULL ,
+ `annotation_id` int(11) NOT NULL,
`posted` INT NOT NULL ,
PRIMARY KEY ( `id` ) ,
KEY `type` (`type`),
@@ -364,5 +365,6 @@ CREATE TABLE `prefix_system_log` (
KEY `access_id` (`access_id`),
KEY `subject_guid` (`subject_guid`),
KEY `object_guid` (`object_guid`),
+ KEY `annotation_id` (`annotation_id`),
KEY `posted` (`posted`)
) ENGINE = MYISAM DEFAULT CHARSET=utf8;
diff --git a/engine/schema/upgrades/2009091901.sql b/engine/schema/upgrades/2009091901.sql
index 7182c7f76..074d042c3 100644
--- a/engine/schema/upgrades/2009091901.sql
+++ b/engine/schema/upgrades/2009091901.sql
@@ -1,2 +1,3 @@
-- add an additional column to the river table
-ALTER TABLE `prefix_river` ADD COLUMN `annotation_id` int(11) NOT NULL AFTER `posted`; \ No newline at end of file
+ALTER TABLE `prefix_river` ADD COLUMN `annotation_id` int(11) NOT NULL AFTER `object_guid`;
+ALTER TABLE `prefix_river` ADD KEY `annotation_id` (`annotation_id`); \ No newline at end of file