New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split piwik.js in multiple files minor tweak #10449
Conversation
@@ -60,7 +60,7 @@ public function getName() | |||
*/ | |||
public function hasWriteAccess() | |||
{ | |||
return $this->hasReadAccess() && is_writable($this->file); | |||
return is_writable($this->file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully it's fine to just check whether file is writable. It solves the issue when the target file does not exist yet, hasWriteAccess should return true when the file can be created/written to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: I had it like this on purpose for now and in tests just created the file in advance
We now need to update the tests that create this file in advance and also |
After removing the file_put_contents the JavaScript tests fail with
I'm wondering whether it's caused by my change or not. I'll try to re-add the file_put_contents again and see |
…_put_contents($targetFile, '');
Works if I leave the file_put_contents so I'll leave it for now... |
If it works when you leave the file_put_contents, this PR (https://github.com/piwik/piwik/pull/10449/files#diff-296a183c286a6fe5a8c5d1ae4ecea1d3L63) seems to not 100% work |
Be good to add a test for this as I don't think it works. I think there might be even a test that would have failed otherwise if it worked so no test would have needed but not sure |
@tsteur I'm a bit confused here... can't think of a case where it does not work. willing to leave it as is unless you point me to the issue (hope i'm not lazy) |
If your PR worked it would fail eg https://github.com/piwik/piwik/blob/2.x-dev/plugins/CustomPiwikJs/tests/Integration/FileTest.php#L69 See http://us2.php.net/manual/en/function.is-writable.php |
This test should only fail when the |
Ok now it's clear, thanks, see the PR that fixes the issue https://github.com/piwik/piwik/pull/10576/files |
* 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
refs #10441