Merge pull request #250 from chrometoasters/pulls/249-no-translations

Fix link hreflang meta tags being output when there are no translations
This commit is contained in:
Damian Mooyman 2016-08-12 13:50:01 +12:00 committed by GitHub
commit 6931031bc9

View File

@ -1574,7 +1574,7 @@ class Translatable extends DataExtension implements PermissionProvider {
function MetaTags(&$tags) { function MetaTags(&$tags) {
$template = '<link rel="alternate" type="text/html" title="%s" hreflang="%s" href="%s" />' . "\n"; $template = '<link rel="alternate" type="text/html" title="%s" hreflang="%s" href="%s" />' . "\n";
$translations = $this->owner->getTranslations(); $translations = $this->owner->getTranslations();
if($translations) { if($translations->count()) {
$translations = $translations->toArray(); $translations = $translations->toArray();
$translations[] = $this->owner; $translations[] = $this->owner;