Skip to content

Commit

Permalink
2.16.3-rc1 (#10590)
Browse files Browse the repository at this point in the history
* Fix depraction test: use assertDeprecatedMethodIsRemovedInPiwik3

* Fix Scheduled Reports sent one hour late in daylight saving timezones (#10443)

* convert hour to send report to/from UTC, to ensure it isn't affected by daylight savings

* adds update script to change existing scheduled reports to use utc time

* code improvement

* adds missing param

* Added new event Archiving.makeNewArchiverObject to  allow customising plugin archiving  (#10366)

* added hook to alllow plugin archiving prevention

* cr code style notes

* reworked PR to fit CR suggestions

* added PHPDoc for hook

* Event description more consistent

* UI tests: minor changes

* Comment out Visitor Log UI tests refs #10536

* Adds test checking if all screenshots are stored in lfs

* removed screenshots not stored in lfs

* readds screenshots to lfs

* 2.16.3-b4

* Issue translation updates against 2.x-dev

* language update

* Fix bug in widget list remove where the JSON object becomes array

* 2.16.3-rc1

* console command custom-piwik-js:update should work when directory is writable and file does not exist yet (#10576)

* followup #10449

* Fix test
(cherry picked from commit fac3d63)

* Prevent chmod(): No such file or directory

* Automatically update all marketplace plugins when updating Piwik (#10527)

* update plugins and piwik at the same time

* make sure plugins are updated with piwik

* use only one try/catch

* reload plugin information once it has been installed

* make sure to clear caches after an update

* fix ui tests

* make sure to use correct php version without any extras

* Additional informations passed in the hook "isExcludedVisit" (issue #10415) (#10564)

* Additional informations passed in the hook "isExcludedVisit" (issue #10415)

* Added better description to the new parameters

* Update VisitExcluded.php

* Remove two parameters not needed as better to use the Request object

* Update VisitExcluded.php

* remove extra two parameters in VisitExcluded constructor to prevent confusion (#10593)

* Update our libs to latest #10526

* Update composer libraries to latest #10526

* Update log analytics to latest

* When updating the config file failed (or when any other file is not writable...), the Updater (for core or plugins) will now automatically throw an error and cancel the update (#10423)

* When updating the config file failed (or when any other file is not writable...), the Updater (for core or plugins) will now automatically throw an error and cancel the update

* add integration test to check the correct exception is thrown when config not writabel

* New integration test for updater

* Make test better

* When opening the visitor profile, do not apply the segment (#10533)

* When opening the visitor profile, do not apply the segment

* added ui test for profile but does work for me

* next try to make ui test work

* add expected screenshot

* added missing doc
  • Loading branch information
mattab committed Sep 29, 2016
1 parent a8f682a commit bd52172
Show file tree
Hide file tree
Showing 71 changed files with 732 additions and 288 deletions.
99 changes: 54 additions & 45 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions core/Config.php
Expand Up @@ -12,6 +12,7 @@
use Exception;
use Piwik\Application\Kernel\GlobalSettingsProvider;
use Piwik\Container\StaticContainer;
use Piwik\Exception\MissingFilePermissionException;
use Piwik\ProfessionalServices\Advertising;

/**
Expand Down Expand Up @@ -375,15 +376,18 @@ public function dumpConfig()
*/
protected function writeConfig($clear = true)
{
if ($this->doNotWriteConfigInTests) {
return;
}

$output = $this->dumpConfig();
if ($output !== null
&& $output !== false
) {
$success = @file_put_contents($this->getLocalPath(), $output);

if ($this->doNotWriteConfigInTests) {
// simulate whether it would be successful
$success = is_writable($this->getLocalPath());
} else {
$success = @file_put_contents($this->getLocalPath(), $output);
}

if ($success === false) {
throw $this->getConfigNotWritableException();
}
Expand Down Expand Up @@ -411,6 +415,6 @@ public function forceSave()
public function getConfigNotWritableException()
{
$path = "config/" . basename($this->getLocalPath());
return new Exception(Piwik::translate('General_ConfigFileIsNotWritable', array("(" . $path . ")", "")));
return new MissingFilePermissionException(Piwik::translate('General_ConfigFileIsNotWritable', array("(" . $path . ")", "")));
}
}
17 changes: 11 additions & 6 deletions core/Plugin.php
Expand Up @@ -137,17 +137,22 @@ public function __construct($pluginName = false)
if ($cache->contains($cacheId)) {
$this->pluginInformation = $cache->fetch($cacheId);
} else {
$metadataLoader = new MetadataLoader($pluginName);
$this->pluginInformation = $metadataLoader->load();

if ($this->hasDefinedPluginInformationInPluginClass() && $metadataLoader->hasPluginJson()) {
throw new \Exception('Plugin ' . $pluginName . ' has defined the method getInformation() and as well as having a plugin.json file. Please delete the getInformation() method from the plugin class. Alternatively, you may delete the plugin directory from plugins/' . $pluginName);
}
$this->reloadPluginInformation();

$cache->save($cacheId, $this->pluginInformation);
}
}

public function reloadPluginInformation()
{
$metadataLoader = new MetadataLoader($this->pluginName);
$this->pluginInformation = $metadataLoader->load();

if ($this->hasDefinedPluginInformationInPluginClass() && $metadataLoader->hasPluginJson()) {
throw new \Exception('Plugin ' . $this->pluginName . ' has defined the method getInformation() and as well as having a plugin.json file. Please delete the getInformation() method from the plugin class. Alternatively, you may delete the plugin directory from plugins/' . $this->pluginName);
}
}

private function createCacheIfNeeded()
{
if (is_null($this->cache)) {
Expand Down
21 changes: 7 additions & 14 deletions core/Tracker/VisitExcluded.php
Expand Up @@ -28,25 +28,16 @@ class VisitExcluded

/**
* @param Request $request
* @param bool|string $ip
* @param bool|string $userAgent
*/
public function __construct(Request $request, $ip = false, $userAgent = false)
public function __construct(Request $request)
{
$this->spamFilter = new ReferrerSpamFilter();

if (false === $ip) {
$ip = $request->getIp();
}

if (false === $userAgent) {
$userAgent = $request->getUserAgent();
}

$this->request = $request;
$this->idSite = $request->getIdSite();
$this->userAgent = $userAgent;
$this->ip = $ip;
$userAgent = $request->getUserAgent();
$this->userAgent = Common::unsanitizeInputValue($userAgent);
$this->ip = $request->getIp();
}

/**
Expand Down Expand Up @@ -89,8 +80,10 @@ public function isExcluded()
* @param bool &$excluded Whether the request should be excluded or not. Initialized
* to `false`. Event subscribers should set it to `true` in
* order to exclude the request.
* @param Request $request The request object which contains all of the request's information
*
*/
Piwik::postEvent('Tracker.isExcludedVisit', array(&$excluded));
Piwik::postEvent('Tracker.isExcludedVisit', array(&$excluded, $this->request));

/*
* Following exclude operations happen after the hook.
Expand Down

0 comments on commit bd52172

Please sign in to comment.