Compare commits
2
Commits
1dc9c9854c
...
55da834396
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55da834396 | ||
|
|
c46bbd952f |
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Grav\Plugin\EntryActions;
|
namespace Grav\Plugin\EntryActions;
|
||||||
|
|
||||||
|
use Grav\Common\Cache;
|
||||||
use Grav\Common\Filesystem\Folder;
|
use Grav\Common\Filesystem\Folder;
|
||||||
use Grav\Plugin\Api\Controllers\AbstractApiController;
|
use Grav\Plugin\Api\Controllers\AbstractApiController;
|
||||||
use Grav\Plugin\Api\Exceptions\ApiException;
|
use Grav\Plugin\Api\Exceptions\ApiException;
|
||||||
@@ -62,7 +63,14 @@ class EntryActionsApiController extends AbstractApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
Folder::delete($path);
|
Folder::delete($path);
|
||||||
|
// deleteAll() drops the cache stores but does NOT rebuild Grav's page-tree
|
||||||
|
// index (keyed on folderHash, which doesn't change on child removal under
|
||||||
|
// cache.check.method: folder). Without invalidateCache() the deleted entry
|
||||||
|
// lingers in the index and the feed re-renders it — now image-less — on the
|
||||||
|
// next load. Mirrors the create-path fix in the cache-on-save plugin. See
|
||||||
|
// docs/solutions/integration-issues/grav-deleteall-doesnt-invalidate-page-tree-index.md
|
||||||
$this->grav['cache']->deleteAll();
|
$this->grav['cache']->deleteAll();
|
||||||
|
Cache::invalidateCache();
|
||||||
// Audit trail: entry deletion is destructive and owner-only — record who
|
// Audit trail: entry deletion is destructive and owner-only — record who
|
||||||
// did it and to what, so an unexpected disappearance is traceable.
|
// did it and to what, so an unexpected disappearance is traceable.
|
||||||
$this->grav['log']->info(sprintf('entry-actions: owner "%s" deleted entry "%s"', $user->username, $slug));
|
$this->grav['log']->info(sprintf('entry-actions: owner "%s" deleted entry "%s"', $user->username, $slug));
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% set trips_page = grav.pages.find('/trips') %}
|
{% set trips_page = grav.pages.find('/trips') %}
|
||||||
{% set trips = trips_page ? trips_page.children.published() : [] %}
|
{# Owner-only page (admin login), so show unpublished trips too — no .published()
|
||||||
|
filter — and order newest first by trip start date so the current/next trip is
|
||||||
|
at the top. #}
|
||||||
|
{% set trips = trips_page ? trips_page.children.order('header.date_start', 'desc') : [] %}
|
||||||
|
|
||||||
<div class="gpx-manager">
|
<div class="gpx-manager">
|
||||||
<h1 class="gpx-manager__title">GPX Files</h1>
|
<h1 class="gpx-manager__title">GPX Files</h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user