mirror of
https://github.com/getgrav/grav.git
synced 2026-07-14 21:12:10 +02:00
Merge branch 'release/1.7.22'
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
# v1.7.22
|
||||
## 09/16/2021
|
||||
|
||||
1. [](#new)
|
||||
* Register plugin autoloaders into plugin objects
|
||||
1. [](#bugfix)
|
||||
* Fixed conflicting `$_original` variable in `Flex Pages`
|
||||
|
||||
# v1.7.21
|
||||
## 09/14/2021
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
// Some standard defines
|
||||
define('GRAV', true);
|
||||
define('GRAV_VERSION', '1.7.21');
|
||||
define('GRAV_VERSION', '1.7.22');
|
||||
define('GRAV_SCHEMA', '1.7.0_2020-11-20_1');
|
||||
define('GRAV_TESTING', false);
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ class PageObject extends FlexPageObject
|
||||
}
|
||||
|
||||
// Reset original after save events have all been called.
|
||||
$this->_original = null;
|
||||
$this->_originalObject = null;
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace Grav\Common;
|
||||
|
||||
use ArrayAccess;
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Grav\Common\Data\Blueprint;
|
||||
use Grav\Common\Data\Data;
|
||||
use Grav\Common\Page\Interfaces\PageInterface;
|
||||
@@ -42,6 +43,8 @@ class Plugin implements EventSubscriberInterface, ArrayAccess
|
||||
protected $active = true;
|
||||
/** @var Blueprint|null */
|
||||
protected $blueprint;
|
||||
/** @var ClassLoader|null */
|
||||
protected $loader;
|
||||
|
||||
/**
|
||||
* By default assign all methods as listeners using the default priority.
|
||||
@@ -79,6 +82,24 @@ class Plugin implements EventSubscriberInterface, ArrayAccess
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ClassLoader|null
|
||||
* @internal
|
||||
*/
|
||||
final public function getAutoloader(): ?ClassLoader
|
||||
{
|
||||
return $this->loader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ClassLoader|null $loader
|
||||
* @internal
|
||||
*/
|
||||
final public function setAutoloader(?ClassLoader $loader): void
|
||||
{
|
||||
$this->loader = $loader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Config $config
|
||||
* @return $this
|
||||
|
||||
@@ -143,7 +143,7 @@ class Plugins extends Iterator
|
||||
$instance->setConfig($config);
|
||||
// Register autoloader.
|
||||
if (method_exists($instance, 'autoload')) {
|
||||
$instance->autoload();
|
||||
$instance->setAutoloader($instance->autoload());
|
||||
}
|
||||
// Register event listeners.
|
||||
$events->addSubscriber($instance);
|
||||
|
||||
@@ -50,7 +50,7 @@ class FlexPageObject extends FlexObject implements PageInterface, FlexTranslateI
|
||||
/** @var array|null */
|
||||
protected $_reorder;
|
||||
/** @var FlexPageObject|null */
|
||||
protected $_original;
|
||||
protected $_originalObject;
|
||||
|
||||
/**
|
||||
* Clone page.
|
||||
@@ -264,7 +264,7 @@ class FlexPageObject extends FlexObject implements PageInterface, FlexTranslateI
|
||||
*/
|
||||
public function getOriginal()
|
||||
{
|
||||
return $this->_original;
|
||||
return $this->_originalObject;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -276,8 +276,8 @@ class FlexPageObject extends FlexObject implements PageInterface, FlexTranslateI
|
||||
*/
|
||||
public function storeOriginal(): void
|
||||
{
|
||||
if (null === $this->_original) {
|
||||
$this->_original = clone $this;
|
||||
if (null === $this->_originalObject) {
|
||||
$this->_originalObject = clone $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user