Added default picture if preview picture is null

This commit is contained in:
Nicolas Lœuillet 2016-10-07 15:21:31 +02:00
parent 21d82c3c5d
commit d5c45d5288
No known key found for this signature in database
GPG key ID: 5656BE27E1E34D0A
2 changed files with 3 additions and 0 deletions

View file

@ -32,6 +32,8 @@
<meta property="og:url" content="{{ app.request.uri }}" />
{% if entry.previewPicture is not null %}
<meta property="og:image" content="{{ entry.previewPicture }}" />
{% else %}
<meta property="og:image" content="{{ app.request.schemeAndHttpHost }}{{ asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png') }}" />
{% endif %}
</head>
<body>

View file

@ -781,6 +781,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertContains('og:title', $client->getResponse()->getContent());
$this->assertContains('og:type', $client->getResponse()->getContent());
$this->assertContains('og:url', $client->getResponse()->getContent());
$this->assertContains('og:image', $client->getResponse()->getContent());
// sharing is now disabled
$client->getContainer()->get('craue_config')->set('share_public', 0);