Skip to content

Commit 4f35b21

Browse files
Fix broken build comments link (#3476)
index.php rows currently display an icon when comments have been left on a build. That icon links to a broken AJAX route. This PR resolves the issue by linking to the build summary page where the comments are already displayed.
1 parent 9f87d4e commit 4f35b21

5 files changed

Lines changed: 2 additions & 36 deletions

File tree

app/Http/Controllers/BuildController.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -862,22 +862,6 @@ public function build_file(int $build_id, int $file_id): StreamedResponse
862862
}, $filename, $headers, 'inline');
863863
}
864864

865-
public function ajaxBuildNote(): View
866-
{
867-
$this->setBuildById((int) ($_GET['buildid'] ?? -1));
868-
Gate::authorize('edit-project', $this->project);
869-
870-
$notes = DB::select('SELECT * FROM comments WHERE buildid=? ORDER BY timestamp ASC', [$this->build->Id]);
871-
foreach ($notes as $note) {
872-
/** @var User $user */
873-
$user = User::where('id', (int) $note->userid)->first();
874-
$note->user = $user;
875-
}
876-
877-
return $this->view('build.note', 'Notes')
878-
->with('notes', $notes);
879-
}
880-
881865
public function apiViewBuildError(): JsonResponse
882866
{
883867
$pageTimer = new PageTimer();

phpstan-baseline.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ parameters:
693693
-
694694
rawMessage: Cannot cast mixed to int.
695695
identifier: cast.int
696-
count: 12
696+
count: 11
697697
path: app/Http/Controllers/BuildController.php
698698

699699
-

resources/js/angular/views/partials/build.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
<!-- Display the note icon -->
9292
<a class="cdash-link" name="Build Notes" id="buildnote_{{::build.id}}"
9393
ng-if="::build.buildnotes > 0"
94-
ng-href="ajax/buildnote.php?buildid={{::build.id}}">
94+
ng-href="builds/{{::build.id}}">
9595
<span class="glyphicon glyphicon-comment" style="color: #337ab7; margin-right: 4px;"></span>
9696
</a>
9797

resources/views/build/note.blade.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

routes/web.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,6 @@
317317
return redirect('/sites', 301);
318318
});
319319

320-
Route::get('/ajax/buildnote.php', 'BuildController@ajaxBuildNote');
321-
322320
Route::get('/projects/{projectId}/invitations/{invitationId}', ProjectInvitationController::class)
323321
->whereNumber('projectId')
324322
->whereNumber('invitationId');

0 commit comments

Comments
 (0)