@@ -258,22 +258,31 @@ public function indexAction(Request $request): Response
258
258
} else {
259
259
$ contestactions [] = [];
260
260
}
261
- if ($ this ->isGranted ('ROLE_ADMIN ' ) && !$ contest ->isLocked ()) {
262
- $ contestactions [] = [
263
- 'icon ' => 'edit ' ,
264
- 'title ' => 'edit this contest ' ,
265
- 'link ' => $ this ->generateUrl ('jury_contest_edit ' , [
266
- 'contestId ' => $ contest ->getCid (),
267
- ])
268
- ];
269
- $ contestactions [] = [
270
- 'icon ' => 'trash-alt ' ,
271
- 'title ' => 'delete this contest ' ,
272
- 'link ' => $ this ->generateUrl ('jury_contest_delete ' , [
273
- 'contestId ' => $ contest ->getCid (),
274
- ]),
275
- 'ajaxModal ' => true ,
276
- ];
261
+ if ($ this ->isGranted ('ROLE_ADMIN ' )) {
262
+ if ($ contest ->isLocked ()) {
263
+ // The number of table columns and thus the number of actions need
264
+ // to match for all rows to not get DataTables errors.
265
+ // Since we add two actions for non-locked contests, we need to add
266
+ // two empty actions for locked contests.
267
+ $ contestactions [] = [];
268
+ $ contestactions [] = [];
269
+ } else {
270
+ $ contestactions [] = [
271
+ 'icon ' => 'edit ' ,
272
+ 'title ' => 'edit this contest ' ,
273
+ 'link ' => $ this ->generateUrl ('jury_contest_edit ' , [
274
+ 'contestId ' => $ contest ->getCid (),
275
+ ])
276
+ ];
277
+ $ contestactions [] = [
278
+ 'icon ' => 'trash-alt ' ,
279
+ 'title ' => 'delete this contest ' ,
280
+ 'link ' => $ this ->generateUrl ('jury_contest_delete ' , [
281
+ 'contestId ' => $ contest ->getCid (),
282
+ ]),
283
+ 'ajaxModal ' => true ,
284
+ ];
285
+ }
277
286
}
278
287
279
288
$ contestdata ['process_balloons ' ] = [
0 commit comments