@@ -1210,7 +1210,7 @@ func (opts *IssuesOptions) setupSession(sess *xorm.Session) {
1210
1210
}
1211
1211
1212
1212
if opts .IsArchived != util .OptionalBoolNone {
1213
- sess .Join ( "INNER" , "repository" , "issue.repo_id = repository.id" ). And (builder.Eq {"repository.is_archived" : opts .IsArchived .IsTrue ()})
1213
+ sess .And (builder.Eq {"repository.is_archived" : opts .IsArchived .IsTrue ()})
1214
1214
}
1215
1215
1216
1216
if opts .LabelIDs != nil {
@@ -1266,6 +1266,8 @@ func CountIssuesByRepo(opts *IssuesOptions) (map[int64]int64, error) {
1266
1266
sess := x .NewSession ()
1267
1267
defer sess .Close ()
1268
1268
1269
+ sess .Join ("INNER" , "repository" , "`issue`.repo_id = `repository`.id" )
1270
+
1269
1271
opts .setupSession (sess )
1270
1272
1271
1273
countsSlice := make ([]* struct {
@@ -1292,11 +1294,12 @@ func GetRepoIDsForIssuesOptions(opts *IssuesOptions, user *User) ([]int64, error
1292
1294
sess := x .NewSession ()
1293
1295
defer sess .Close ()
1294
1296
1297
+ sess .Join ("INNER" , "repository" , "`issue`.repo_id = `repository`.id" )
1298
+
1295
1299
opts .setupSession (sess )
1296
1300
1297
1301
accessCond := accessibleRepositoryCondition (user )
1298
1302
if err := sess .Where (accessCond ).
1299
- Join ("INNER" , "repository" , "`issue`.repo_id = `repository`.id" ).
1300
1303
Distinct ("issue.repo_id" ).
1301
1304
Table ("issue" ).
1302
1305
Find (& repoIDs ); err != nil {
@@ -1311,6 +1314,7 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
1311
1314
sess := x .NewSession ()
1312
1315
defer sess .Close ()
1313
1316
1317
+ sess .Join ("INNER" , "repository" , "`issue`.repo_id = `repository`.id" )
1314
1318
opts .setupSession (sess )
1315
1319
sortIssuesSession (sess , opts .SortType , opts .PriorityRepoID )
1316
1320
@@ -1338,6 +1342,7 @@ func CountIssues(opts *IssuesOptions) (int64, error) {
1338
1342
}, 0 , 1 )
1339
1343
1340
1344
sess .Select ("COUNT(issue.id) AS count" ).Table ("issue" )
1345
+ sess .Join ("INNER" , "repository" , "`issue`.repo_id = `repository`.id" )
1341
1346
opts .setupSession (sess )
1342
1347
if err := sess .Find (& countsSlice ); err != nil {
1343
1348
return 0 , fmt .Errorf ("Find: %v" , err )
0 commit comments