From: Nicolas LÅ“uillet Date: Tue, 27 Dec 2016 20:26:53 +0000 (+0100) Subject: Fixed export by tags with a tag which contains space X-Git-Tag: 2.2.0~3^2~18^2 X-Git-Url: https://git.immae.eu/?p=github%2Fwallabag%2Fwallabag.git;a=commitdiff_plain;h=c8de7ab94cb2d8880205c450ebf52d225991df6e Fixed export by tags with a tag which contains space --- diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 52707cb8..8a093289 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -143,7 +143,7 @@ class TagController extends Controller 'form' => null, 'entries' => $entries, 'currentPage' => $page, - 'tag' => $tag->getLabel(), + 'tag' => $tag->getSlug(), ]); } } diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php index 09e99f36..6de561e0 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php @@ -15,7 +15,7 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager) { $tag1 = new Tag(); - $tag1->setLabel('foo'); + $tag1->setLabel('foo bar'); $manager->persist($tag1); diff --git a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php index 5ca886bd..32a18e26 100644 --- a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php @@ -119,7 +119,7 @@ class ExportControllerTest extends WallabagCoreTestCase $this->assertEquals('binary', $headers->get('content-transfer-encoding')); ob_start(); - $crawler = $client->request('GET', '/export/tag_entries.pdf?tag=foo'); + $crawler = $client->request('GET', '/export/tag_entries.pdf?tag=foo-bar'); ob_end_clean(); $this->assertEquals(200, $client->getResponse()->getStatusCode()); @@ -241,7 +241,7 @@ class ExportControllerTest extends WallabagCoreTestCase $this->assertEquals($contentInDB->getLanguage(), $content[0]['language']); $this->assertEquals($contentInDB->getReadingtime(), $content[0]['reading_time']); $this->assertEquals($contentInDB->getDomainname(), $content[0]['domain_name']); - $this->assertEquals(['foo', 'baz'], $content[0]['tags']); + $this->assertEquals(['foo bar', 'baz'], $content[0]['tags']); } public function testXmlExport() diff --git a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php index 769ce66e..fa1a3539 100644 --- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php @@ -61,7 +61,7 @@ class TagControllerTest extends WallabagCoreTestCase // tag already exists but still not assigned to this entry $data = [ - 'tag[label]' => 'foo', + 'tag[label]' => 'foo bar', ]; $client->submit($form, $data);