We have moved to Github. Please open tickets there.

Opened 3 years ago

Closed 3 years ago

#1406 closed Defect (fixed)

get_entity_dates() needs order

Reported by: marcus Owned by:
Priority: normal Milestone: Elgg 1.7
Component: Core Version: 1.6
Severity: minor Keywords:
Cc: brettp Difficulty:

Description

Currently get_entity_dates does not order query which results in an unsorted menu.

E.g.:

--- /tmp/entities.php 2009-12-08 18:34:12.000000000 +0000
+++ entities.php 2009-12-08 18:31:10.000000000 +0000
@@ -1625,7 +1625,7 @@

  • @return string A viewable list of entities */

function list_entities($type= "", $subtype = "", $owner_guid = 0, $limit = 10, $fullview = true, $viewtypetoggle = false, $pagination = true) {

-
+

$offset = (int) get_input('offset');
$count = get_entities($type, $subtype, $owner_guid, "", $limit, $offset, true);
$entities = get_entities($type, $subtype, $owner_guid, "", $limit, $offset);

@@ -1721,7 +1721,7 @@

$sql = "SELECT DISTINCT EXTRACT(YEAR_MONTH FROM FROM_UNIXTIME(time_created)) AS yearmonth FROM {$CONFIG->dbprefix}entities where ";
foreach ($where as $w)

$sql .= " $w and ";

  • $sql .= "1=1";

+ $sql .= "1=1 order by time_created";

if ($result = get_data($sql)) {

$endresult = array();
foreach($result as $res) {

Change History (1)

comment:1 Changed 3 years ago by brettp

  • Resolution set to fixed
  • Status changed from new to closed

(In [svn:3892]) Fixes #1406: get_entity_dates() supports order by.

Note: See TracTickets for help on using tickets.