Fixed MediaTrait::getMedia() to return refreshed Media object after calling MediaTrait::clearMediaCache()

This commit is contained in:
Matias Griese
2019-01-23 11:20:44 +02:00
parent 243055289b
commit e6b6e218f8
3 changed files with 7 additions and 2 deletions

View File

@@ -25,6 +25,7 @@
* Fixed failed login if user attempts to log in with upper case non-english letters
* Removed extra authenticated/authorized fields when saving existing user from a form
* Fixed `Grav\Framework\Route::__toString()` returning relative URL, not relative route
* Fixed `MediaTrait::getMedia()` to return refreshed `Media` object after calling `MediaTrait::clearMediaCache()`
# v1.6.0-beta.7
## 12/14/2018

View File

@@ -23,7 +23,10 @@ trait MediaTrait
*
* @return array Empty array means default ordering.
*/
abstract public function getMediaOrder();
public function getMediaOrder()
{
return [];
}
/**
* Get URI ot the associated media. Method will return null if path isn't URI.
@@ -95,6 +98,8 @@ trait MediaTrait
$cache = $this->getMediaCache();
$cacheKey = md5('media' . $this->getCacheKey());
$cache->delete($cacheKey);
$this->media = null;
}
/**

View File

@@ -10,7 +10,6 @@ namespace Grav\Common\Service;
use Grav\Common\Config\Config;
use Grav\Common\Debugger;
use Grav\Common\Inflector;
use Grav\Common\Session;
use Grav\Common\Uri;
use Pimple\Container;