Note that there are some explanatory texts on larger screens.

plurals
  1. POThe <title> tag becomes empty on my homepage
    primarykey
    data
    text
    <p>I'm having some weird problem with my <code>&lt;title&gt;</code> tag on my homepage (the problem occurs only on this page). The title does appear and after some refresh disappear (meaning I have <code>&lt;title&gt;Homepage&lt;/title&gt;</code> and then <code>&lt;title&gt;&lt;/title&gt;</code>)</p> <p>The problem occurs only on my production server. There's no problem on dev servers.</p> <p>The problem seems to be resolved if I do create another configuration mode. For instance, I tried with my <code>bypassmode.php</code> (a copy from <code>index.php</code> but with new values: <code>prod</code> => <code>bypass</code> in my <code>app.yml</code> &amp; <code>doctrine.yml</code>).</p> <p>When I edit on production the <code>view.yml</code> to change title and then I <code>./symfony cc</code>, it works again but disappear after a refresh. Same as when I do add the <code>$response-&gt;setTitle('Homepage');</code> directly in the action.</p> <p>I've taken a look at the cache file <code>./cache/frontend/prod/config/modules_home_config_view.yml.php</code> but the title is set correctly.</p> <p>I'm running out of ideas... Any suggestions ?</p> <p>EDIT: As suggested below, I moved my <code>&lt;title&gt;</code> the closest possible to the <code>&lt;head&gt;</code> but it did not change anything. </p> <p>After further investigation in <code>function include_title()</code>, is it possible that sfContext::getInstance()->getResponse()->getTitle(); might be undefined ? May APC be a problem ?</p> <p>I'm considering editing <code>AssetHelper.php</code>:</p> <pre><code>function include_title() { $title = sfContext::getInstance()-&gt;getResponse()-&gt;getTitle(); // Adding some ugly patch here if (empty($title)) $title = "Default title for my homepage"; // End nasty patch echo content_tag('title', $title)."\n"; } </code></pre> <p>But this is so dirty that I wish I can find any other cleaner solution...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload