DemocraciaEnRed / participes-app

Plataforma digital que permite la publicacion de metas y compromisos de gobierno facilitando el seguimiento ciudadano
https://democraciaos.org/es/seguimientometas
GNU General Public License v3.0
5 stars 3 forks source link

When a Report associated to the accomplishment of a Milestone is deleted, some views fails, because there is no report #53

Open guillecro opened 1 year ago

guillecro commented 1 year ago
(Facade\\Ignition\\Exceptions\\ViewException(code: 0): Trying to get property 'id' of non-object (View: /home/runcloud/webapps/participes/resources/views/objective/goal/view.blade.php) at /home/runcloud/webapps/participes/resources/views/objective/goal/view.blade.php:94)
[stacktrace]
#0 /home/runcloud/webapps/participes/resources/views/objective/goal/view.blade.php(94): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()

For example, this line

<span class="text-muted">Fecha de completado: @justdate($milestone->completed) - <a href="{{route('reports.index',['reportId' => $milestone->report->id])}}">Ver el reporte<i class="fas fa-arrow-right fa-fw"></i></a></span>

$milestone->report->id just fails because there is no report for the milestone (deleted_at is not null)

Still need to think that happens, some thoughts: