Meta Charset duplicated in maintenance mode - Forum | JoomShaper
Solved Helix Framework

Meta Charset duplicated in maintenance mode

Asked by David Forés 1 year ago Last activity 1 year ago

Hello,

I'm building a new website, and when I activate the "maintenance mode" I notice in the source code that this line is duplicated:

<meta charset="utf-8">

The beginning of the source code looks like this:

<!doctype html>
<html class="coming-soon" lang="es" dir="ltr">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta charset="utf-8">
        ...

I have been doing some research and I think the problem is in line 48 of the file:

\plugins\system\helixultimate\overrides\layouts\comingsoon.php

This meta tag is included here, and subsequently a call is made, in line 51, to:

$theme->head();

This call will end up calling the MetasRender that will add the duplicated meta tag again.

\libraries\src\Document\Renderer\Html\MetasRenderer.php

Lines 99-102:

// Generate charset when using HTML5 (should happen first)
        if ($this->_doc->isHtml5()) {
            $buffer .= $tab . '<meta charset="' . $this->_doc->getCharset() . '">' . $lnEnd;
        }

Joomla: 5.2.6
Helix Ultimate: 2.1.2

Accepted answer

Marked as the solution
Toufiq Senior Staff

I will inform our team. Thank you

1 more reply

Toufiq Senior Staff

Hi there,

Thank you for reaching out, and I apologize for any inconvenience caused by this oversight. Can you produce the issue on this URL?

Best regards,

Toufiqur Rahman (Team Lead, Support)

David Forés Asked this

Hello Toufiq,

I've already reproduced the issue.

I've simply changed in backend:

Global Configuration > Site
   Site Offline: Yes

And now the source code has this:

<!doctype html>
<html class="coming-soon" lang="en-gb" dir="ltr">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta charset="utf-8">
    <meta name="generator" content="Helix Ultimate - The Most Popular Joomla! Template Framework.">
    <title>Home</title>
    ...

As I mentioned in the first message, the solution is to delete line 48 in this file.

\plugins\system\helixultimate\overrides\layouts\comingsoon.php
Toufiq Senior Staff

plugins/system/helixultimate/overrides/layouts/comingsoon.php

Find out this code from this file location & remove this code.

https://prnt.sc/LjYRPucb_mdy

<meta charset="utf-8">

David Forés Asked this

Yes, that's exactly what I was telling you.

I already had the fix done in my project, I just reported it here so you can add it to the list of fixes for the next release of Helix Ultimate :)

Log in to reply.