mirror of
https://github.com/getgrav/grav.git
synced 2026-02-22 14:38:13 +01:00
Merge branch 'develop' of github.com:getgrav/grav into develop
# Conflicts: # CHANGELOG.md
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
# v1.7.25
|
||||
## mm/dd/2021
|
||||
|
||||
2. [](#improved)
|
||||
1. [](#improved)
|
||||
* Use Symfony `dump` instead of PHP's `vardump` in side the `{{ vardump(x) }}` Twig vardump function
|
||||
* Added `route` and `request` to `onPagesInitialized` event
|
||||
* Improved page cloning, added method `Page::initialize()`
|
||||
|
||||
|
||||
# v1.7.24
|
||||
## 10/26/2021
|
||||
|
||||
@@ -218,6 +218,25 @@ class Page implements PageInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
$this->initialized = false;
|
||||
$this->header = $this->header ? clone $this->header : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(): void
|
||||
{
|
||||
if (!$this->initialized) {
|
||||
$this->initialized = true;
|
||||
$this->route = null;
|
||||
$this->raw_route = null;
|
||||
$this->_forms = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@@ -42,15 +42,29 @@ class PagesProcessor extends ProcessorBase
|
||||
$this->container['debugger']->addMessage($this->container['cache']->getCacheStatus());
|
||||
|
||||
$this->container['pages']->init();
|
||||
$this->container->fireEvent('onPagesInitialized', new Event(['pages' => $this->container['pages']]));
|
||||
$this->container->fireEvent('onPageInitialized', new Event(['page' => $this->container['page']]));
|
||||
|
||||
$route = $this->container['route'];
|
||||
|
||||
$this->container->fireEvent('onPagesInitialized', new Event(
|
||||
[
|
||||
'pages' => $this->container['pages'],
|
||||
'route' => $route,
|
||||
'request' => $request
|
||||
]
|
||||
));
|
||||
$this->container->fireEvent('onPageInitialized', new Event(
|
||||
[
|
||||
'page' => $this->container['page'],
|
||||
'route' => $route,
|
||||
'request' => $request
|
||||
]
|
||||
));
|
||||
|
||||
/** @var PageInterface $page */
|
||||
$page = $this->container['page'];
|
||||
|
||||
if (!$page->routable()) {
|
||||
$exception = new RequestException($request, 'Page Not Found', 404);
|
||||
$route = $this->container['route'];
|
||||
// If no page found, fire event
|
||||
$event = new Event([
|
||||
'page' => $page,
|
||||
|
||||
Reference in New Issue
Block a user