mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-09-23 06:39:18 +00:00
Trap corner case when collection only has a single entry.
This commit is contained in:
parent
f383971936
commit
1e7a71c1bb
@ -20,6 +20,8 @@ if ( $request->IsCollection() ) {
|
|||||||
/**
|
/**
|
||||||
* The CalDAV specification does not define GET on a collection, but typically this is
|
* The CalDAV specification does not define GET on a collection, but typically this is
|
||||||
* used as a .ics download for the whole collection, which is what we do also.
|
* used as a .ics download for the whole collection, which is what we do also.
|
||||||
|
*
|
||||||
|
* @todo Change this to reference the collection_id of the collection at this location.
|
||||||
*/
|
*/
|
||||||
$order_clause = ( isset($c->strict_result_ordering) && $c->strict_result_ordering ? " ORDER BY dav_id" : "");
|
$order_clause = ( isset($c->strict_result_ordering) && $c->strict_result_ordering ? " ORDER BY dav_id" : "");
|
||||||
$qry = new PgQuery( "SELECT caldav_data, class, caldav_type, calendar_item.user_no, logged_user FROM caldav_data INNER JOIN calendar_item USING ( dav_id ) WHERE caldav_data.user_no = ? AND caldav_data.dav_name ~ ? $order_clause", $request->user_no, $request->path.'[^/]+$');
|
$qry = new PgQuery( "SELECT caldav_data, class, caldav_type, calendar_item.user_no, logged_user FROM caldav_data INNER JOIN calendar_item USING ( dav_id ) WHERE caldav_data.user_no = ? AND caldav_data.dav_name ~ ? $order_clause", $request->user_no, $request->path.'[^/]+$');
|
||||||
@ -31,7 +33,7 @@ else {
|
|||||||
if ( !$qry->Exec("GET") ) {
|
if ( !$qry->Exec("GET") ) {
|
||||||
$request->DoResponse( 500, translate("Database Error") );
|
$request->DoResponse( 500, translate("Database Error") );
|
||||||
}
|
}
|
||||||
else if ( $qry->rows == 1 ) {
|
else if ( $qry->rows == 1 && ! $request->IsCollection() ) {
|
||||||
$event = $qry->Fetch();
|
$event = $qry->Fetch();
|
||||||
|
|
||||||
/** Default deny... */
|
/** Default deny... */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user