-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
implement bookmarklet #1471
implement bookmarklet #1471
Conversation
{ | ||
$entry = new Entry($this->getUser()); | ||
$entry->setUrl($request->get('url')); | ||
$this->updateEntry($entry); |
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 can simplify to :
$this->updateEntry(new Entry($this->getUser()), $request->get('url'));
Hum, no sorry..
Route changed & test added. |
public function addEntryViaBookmarklet(Request $request) | ||
{ | ||
$url = $request->get('url'); | ||
if (filter_var($url, FILTER_VALIDATE_URL)) { |
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'm curious, what happend if you don't do that? You got an exception or sth?
This kind of verification is already done in graby.
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's an exception launched by graby. I have to catch it in fact.
I removed the test about "Bad URL". In fact, the behaviour if we have a bad URL is the same as before: we create a new entry with no content and "fakeURL" in the URL field. |
71afa9a
to
01f2c84
Compare
Tests are green but GitHub lost the relation with travis https://travis-ci.org/wallabag/wallabag |
Maybe there is something to fix in graby but ContentProxy also need to handle Exception in case of graby fail. |
@@ -5,6 +5,7 @@ | |||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |||
use Symfony\Component\HttpFoundation\Request; | |||
use Symfony\Component\Security\Acl\Exception\Exception; |
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.
Is it used somewhere?
(php-cs-fixer is your friend)
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.
thanks for your vigilence.
ready to be rebased. |
Good to be rebased and then merged 👍 |
cf07082
to
880a0e1
Compare
Do we need a test for this PR?