Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/getgrav/grav into 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Apr 30, 2018
2 parents 0b1c18d + 40b475e commit 4d69093
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion system/blueprints/pages/modular.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ form:

modular_title:
type: spacer
title: Modular Setup
title: PLUGIN_ADMIN.MODULAR_SETUP

header.content.items:
type: text
Expand Down
9 changes: 9 additions & 0 deletions system/src/Grav/Common/Helpers/Excerpts.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,15 @@ public static function processMediaActions($medium, $url)
if (Grav::instance()['config']->get('system.images.auto_fix_orientation')) {
$actions[] = ['method' => 'fixOrientation', 'params' => ''];
}
$defaults = Grav::instance()['config']->get('system.images.defaults');
if (is_array($defaults) && count($defaults)) {
foreach ($defaults as $method => $params) {
$actions[] = [
'method' => $method,
'params' => $params,
];
}
}

// loop through actions for the image and call them
foreach ($actions as $action) {
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Console/Gpm/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected function serve()
//We're done installing dependencies. Install the actual packages
foreach ($this->data as $data) {
foreach ($data as $package_name => $package) {
if (in_array($package_name, array_keys($dependencies))) {
if (array_key_exists($package_name, $dependencies)) {
$this->output->writeln("<green>Package " . $package_name . " already installed as dependency</green>");
} else {
$is_valid_destination = Installer::isValidDestination($this->destination . DS . $package->install_path);
Expand Down
18 changes: 9 additions & 9 deletions tests/unit/Grav/Common/AssetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,49 +499,49 @@ public function testReset()
{
$this->assets->addInlineJs('alert("test")');
$this->assets->reset();
$this->assertSame(0, count((array) $this->assets->js()));
$this->assertCount(0, (array) $this->assets->js());

$this->assets->addAsyncJs('jquery');
$this->assets->reset();

$this->assertSame(0, count((array) $this->assets->js()));
$this->assertCount(0, (array) $this->assets->js());

$this->assets->addInlineCss('body { color: black }');
$this->assets->reset();

$this->assertSame(0, count((array) $this->assets->css()));
$this->assertCount(0, (array) $this->assets->css());

$this->assets->add('/system/assets/debugger.css', null, true);
$this->assets->reset();

$this->assertSame(0, count((array) $this->assets->css()));
$this->assertCount(0, (array) $this->assets->css());
}

public function testResetJs()
{
$this->assets->addInlineJs('alert("test")');
$this->assets->resetJs();
$this->assertSame(0, count((array) $this->assets->js()));
$this->assertCount(0, (array) $this->assets->js());

$this->assets->addAsyncJs('jquery');
$this->assets->resetJs();

$this->assertSame(0, count((array) $this->assets->js()));
$this->assertCount(0, (array) $this->assets->js());
}

public function testResetCss()
{
$this->assertSame(0, count((array) $this->assets->js()));
$this->assertCount(0, (array) $this->assets->js());

$this->assets->addInlineCss('body { color: black }');
$this->assets->resetCss();

$this->assertSame(0, count((array) $this->assets->css()));
$this->assertCount(0, (array) $this->assets->css());

$this->assets->add('/system/assets/debugger.css', null, true);
$this->assets->resetCss();

$this->assertSame(0, count((array) $this->assets->css()));
$this->assertCount(0, (array) $this->assets->css());
}

public function testAddDirCss()
Expand Down

0 comments on commit 4d69093

Please sign in to comment.