mirror of
https://github.com/getgrav/grav.git
synced 2026-01-30 19:30:18 +01:00
Merge branch 'develop' of github.com:getgrav/grav into 1.7
Conflicts: CHANGELOG.md
This commit is contained in:
@@ -186,6 +186,13 @@
|
||||
* Optimization: Initialize debugbar only after the configuration has been loaded
|
||||
* Optimization: Combine some early Grav processors into a single one
|
||||
|
||||
# v1.6.18
|
||||
## mm/dd/2019
|
||||
|
||||
1. [](#bugfix)
|
||||
* Fixed fatal error when `$page->id()` is null [#2731](https://github.com/getgrav/grav/pull/2731)
|
||||
* Fixed cache conflicts on pages with no set id
|
||||
|
||||
# v1.6.17
|
||||
## 11/06/2019
|
||||
|
||||
|
||||
@@ -664,7 +664,7 @@ class Page implements PageInterface
|
||||
// Load cached content
|
||||
/** @var Cache $cache */
|
||||
$cache = Grav::instance()['cache'];
|
||||
$cache_id = md5('page' . $this->id());
|
||||
$cache_id = md5('page' . $this->getCacheKey());
|
||||
$content_obj = $cache->fetch($cache_id);
|
||||
|
||||
if (is_array($content_obj)) {
|
||||
@@ -870,7 +870,7 @@ class Page implements PageInterface
|
||||
public function cachePageContent()
|
||||
{
|
||||
$cache = Grav::instance()['cache'];
|
||||
$cache_id = md5('page' . $this->id());
|
||||
$cache_id = md5('page' . $this->getCacheKey());
|
||||
$cache->save($cache_id, ['content' => $this->content, 'content_meta' => $this->content_meta]);
|
||||
}
|
||||
|
||||
@@ -1901,6 +1901,10 @@ class Page implements PageInterface
|
||||
*/
|
||||
public function id($var = null)
|
||||
{
|
||||
if (null === $this->id) {
|
||||
// We need to set unique id to avoid potential cache conflicts between pages.
|
||||
$var = time() . md5($this->filePath());
|
||||
}
|
||||
if ($var !== null) {
|
||||
// store unique per language
|
||||
$active_lang = Grav::instance()['language']->getLanguage() ?: '';
|
||||
|
||||
Reference in New Issue
Block a user