Skip to content
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

Merged
merged 1 commit into from
Jun 30, 2017
Merged

#1635 image urls encode correctly. #1810

merged 1 commit into from
Jun 30, 2017

Conversation

crcommons
Copy link
Contributor

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

@ushbot
Copy link
Collaborator

ushbot commented Jun 16, 2017

Hey @crcommons,
thank you for your Pull Request.

@rjmackay It looks like this brave person signed our Contributor License Agreement. 👍

Always at your service,

clabot

Copy link
Contributor

@rjmackay rjmackay left a 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());
Copy link
Contributor

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()
Copy link
Contributor

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?

Copy link
Contributor Author

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!

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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));
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@crcommons crcommons force-pushed the 1635-encode-images branch from d772563 to f0b013c Compare June 28, 2017 15:22
.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
Copy link
Contributor

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?

@rjmackay rjmackay force-pushed the 1635-encode-images branch from 104bb61 to 3173a94 Compare June 30, 2017 04:51
Copy link
Contributor

@rjmackay rjmackay left a 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

@rjmackay rjmackay merged commit 30f7a62 into develop Jun 30, 2017
@rjmackay rjmackay deleted the 1635-encode-images branch June 30, 2017 05:07
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3173a94 on 1635-encode-images into ** on develop**.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants