http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692018-06-19T15:26:17ZTYPO3 ForgeTYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3672662018-06-19T15:26:17ZJulian Stelzer
<ul><li><strong>Project</strong> changed from <i>9</i> to <i>TYPO3 Core</i></li><li><strong>Target version</strong> set to <i>9.4</i></li><li><strong>TYPO3 Version</strong> set to <i>9</i></li><li><strong>PHP Version</strong> set to <i>7.2</i></li></ul> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3673012018-06-21T06:33:11ZGeorg Ringer
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs Feedback</i></li></ul><p><code>BackendUtility</code> is for the backend as the name suggests. what are you doing exactly to get this error? you can also initialize the <code>$GLOBALS['BE_USER']</code> yourself in the FE.</p> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3673022018-06-21T09:05:55ZJulian Stelzer
<ul></ul><p>Georg Ringer wrote:</p>
<blockquote>
<p><code>BackendUtility</code> is for the backend as the name suggests. what are you doing exactly to get this error? you can also initialize the <code>$GLOBALS['BE_USER']</code> yourself in the FE.</p>
</blockquote>
<p>I try to save some modeldata in my FE with the add-function of \TYPO3\CMS\Extbase\Persistence\Repository. I dont want to use the $GLOBALS['BE_USER'] or the BackendUtility-Class on my own, but TYPO3 is doing that for me and it causes this error. The same function works great in TYPO3 7.6.</p> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3677952018-06-25T16:35:46ZJan Schrödermail@janschroeder.de
<ul></ul><p>In TYPO3 8.x the function getTSConfig work without and Backend Login. <br />Since TYPO3 9 the getTSConfig is not working anymore in Frontend Context.</p>
<p>Is there a way to create the missing $GLOBALS['BE_USER'] or is there another way to get the TSConfig in frontend context?</p>
<p>The breaking change is not documented and broke the gridelements extension :-(</p> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3682972018-07-04T08:34:41ZJulian Stelzer
<ul></ul><p>It currently breaks all extensions, which write from Frontend into Database and use the repository methods.</p>
<p>Quickfix:<br /><pre><code class="php syntaxhl" data-language="php"> <span class="nv">$userTSconfig</span> <span class="o">=</span> <span class="p">[];</span>
<span class="k">if</span><span class="p">(</span> <span class="k">static</span><span class="o">::</span><span class="nf">getBackendUserAuthentication</span><span class="p">()</span> <span class="p">){</span>
<span class="nv">$userTSconfig</span> <span class="o">=</span> <span class="k">static</span><span class="o">::</span><span class="nf">getBackendUserAuthentication</span><span class="p">()</span><span class="o">-></span><span class="nf">getTSConfig</span><span class="p">()</span> <span class="o">??</span> <span class="p">[];</span>
<span class="p">}</span>
<span class="c1">//$userTSconfig = static::getBackendUserAuthentication()->getTSConfig() ?? [];</span>
</code></pre></p>
<p>But it should be fixed soon.</p> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3694802018-07-27T09:58:37ZSinisa Mitrovicmitrovic.sinisaa@gmail.com
<ul></ul><p>Another quick fix can be initializing BE User before fetching getPagesTSconfig.</p>
<pre><code class="php syntaxhl" data-language="php"> <span class="k">if</span><span class="p">(</span><span class="nv">$GLOBALS</span><span class="p">[</span><span class="s1">'BE_USER'</span><span class="p">]</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
<span class="nv">$GLOBALS</span><span class="p">[</span><span class="s1">'BE_USER'</span><span class="p">]</span> <span class="o">=</span> <span class="nc">GeneralUtility</span><span class="o">::</span><span class="nf">makeInstance</span><span class="p">(</span><span class="s1">'TYPO3\CMS\Core\Authentication\BackendUserAuthentication'</span><span class="p">);</span>
<span class="nv">$GLOBALS</span><span class="p">[</span><span class="s1">'BE_USER'</span><span class="p">]</span><span class="o">-></span><span class="nf">start</span><span class="p">();</span>
<span class="p">}</span>
</code></pre> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3703602018-08-09T08:41:42Zsonal vadhavana
<ul></ul><p>yes, this solution works fine but needs to improve by this one:</p>
<p>First include the namespace and then write code: Otherwise give deprecation error.</p>
<p>use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;</p>
<pre>
if($GLOBALS['BE_USER'] === null) {
$GLOBALS['BE_USER'] = GeneralUtility::makeInstance(BackendUserAuthentication::class);
$GLOBALS['BE_USER']->start();
}
</pre> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3706712018-08-13T13:43:02ZThomas Kieslichthomas.kieslich@gmail.com
<ul></ul><p>If this doesn't work try to set enabledBeUserIPLock to false. checkLockToIP() is called before your own Controller.</p> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3722832018-09-03T15:17:50ZSusanne Moogsusanne.moog@typo3.org
<ul><li><strong>Status</strong> changed from <i>Needs Feedback</i> to <i>Accepted</i></li></ul><p>Problem seems to be that `\TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend::clearPageCache` calls `$pageTS = BackendUtility::getPagesTSconfig($storagePage)` in case of write operations with extbase (delete, update, add), which in turn needs a valid backend user.</p> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3724282018-09-04T09:06:47ZBenni Mackbenni@typo3.org
<ul><li><strong>Related to</strong> <i><a class="issue tracker-4 status-5 priority-4 priority-default closed" href="/issues/82497">Task #82497</a>: Streamline \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig</i> added</li></ul> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3724302018-09-04T09:08:43ZGerrit Code Review
<ul><li><strong>Status</strong> changed from <i>Accepted</i> to <i>Under Review</i></li></ul><p>Patch set 1 for branch <strong>master</strong> of project <strong>Packages/TYPO3.CMS</strong> has been pushed to the review server.<br />It is available at <a class="external" href="https://review.typo3.org/58174">https://review.typo3.org/58174</a></p> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3724412018-09-04T10:30:04ZBenni Mackbenni@typo3.org
<ul><li><strong>Status</strong> changed from <i>Under Review</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="[BUGFIX] Allow getPagesTSconfig to be called without BE_USER Due to refactorings lately in Backe..." href="http://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/3260e09382068949e03cf4d6ca2a497275c2671e">3260e09382068949e03cf4d6ca2a497275c2671e</a>.</p> TYPO3 Core - Bug #85310: $GLOBALS['BE_USER] is null causes Errors in FEhttp://forge.typo3.org/issues/85310?journal_id=3759822018-10-02T10:44:32ZBenni Mackbenni@typo3.org
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>