| @@ -148,6 +148,9 @@ sub db_get_document_object { | |||
| ON p.id = dp.pageId | |||
| WHERE dp.documentId = ?", $id); | |||
| while(my $hash = $q->fetchrow_hashref()) { | |||
| if ( $hash->{isprimary} ) { | |||
| $document->{primary} = $hash->{id}; | |||
| } | |||
| push @pages, $hash; push @pageids, $hash->{id}; | |||
| } | |||
| @@ -179,6 +182,7 @@ sub db_get_document_object { | |||
| my $out = { | |||
| id => $document->{id}, | |||
| pageId => [ @pageids ], | |||
| primaryPage => $document->{primary}, | |||
| name => $document->{name}, | |||
| created => $document->{created}, | |||
| owner => $document->{owner}, | |||