-
Notifications
You must be signed in to change notification settings - Fork 506
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
#1635 image urls encode correctly. #1810
Conversation
Hey @crcommons, @rjmackay It looks like this brave person signed our Contributor License Agreement. 👍 Always at your service, clabot |
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.
Looks good, just minor tidy up needed as called out in my comments.
} else { | ||
return URL::site(Media::uri($this->get_relative_path() . $value), Request::current()); | ||
return URL::site((Media::uri($this->get_relative_path() . $value)), Request::current()); |
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.
It'd be worth adding a comment above this to explain that either URL::site or Media::uri is already encoding the url - so that the next person to look at this knows why we're only encoding in 1 case, not the other.
@@ -80,4 +80,18 @@ public function disableDataImport() | |||
$config = \Kohana::$config->load('features'); | |||
$config->set('data-import.enabled', false); | |||
} | |||
|
|||
/** @BeforeScenario @cdnEnabled */ | |||
public function enableCdn() |
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.
You should remove these before this lands, since they didn't work anyway.
Given we don't have a convenient way to enable/disable the CDN during test runs, we should possibly just run with the CDN enabled for all tests since thats the production state. @willdoran what do you think?
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.
@willdoran Let me know if I should remove or not. Thanks!
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.
@rjmackay @crcommons If it doesn't work then dropping it seems fine. Out of curiosity why doesn't it work?
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.
I can't recall why it didn't work; only that it didn't. @rjmackay may be able to remember and explain.
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.
I removed this and now the checks have failed. @rjmackay Can we touch base on this?
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.
I think the only failure was linting.
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.
If it doesn't work then dropping it seems fine. Out of curiosity why doesn't it work?
@willdoran CDN config doesn't load from the DB, so any changes we make via behat don't stick.
@@ -20,6 +20,7 @@ class Ushahidi_Formatter_API implements Formatter | |||
// Formatter | |||
public function __invoke($entity) | |||
{ | |||
Kohana::$log->add(Log::ERROR, print_r($entity, true)); |
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.
Can you remove the log statement before this lands?
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.
Will do.
d772563
to
f0b013c
Compare
.travis.yml
Outdated
@@ -39,7 +39,7 @@ before_script: | |||
- mysql -e 'SET @@GLOBAL.wait_timeout=1800' | |||
script: | |||
- if [ "${coverage}" == "" ]; then composer test; fi | |||
- if [ "${coverage}" != "" ]; then composer run coverage --timeout=0; fi | |||
- if [ "${coverage}" != "" ]; then composer run coverage --timeout=2000; fi |
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.
So timeout=0 was supposed to remove the timeout entirely. Maybe that stopped working?
104bb61
to
3173a94
Compare
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.
LGTM - I've squashed everything to a single commit too
Changes Unknown when pulling 3173a94 on 1635-encode-images into ** on develop**. |
This pull request makes the following changes:
-correctly encodes image filenames so that there is no whitespace in the url.
Test checklist:
Fixes #1635 .
Ping @ushahidi/platform