http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692018-08-13T10:38:30ZTYPO3 ForgeTYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=3706502018-08-13T10:38:30ZStephan Großberndt
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs Feedback</i></li></ul><p>Did you go to "User settings" -> "Edit and Advanced functions" and enabled the checkbox at "Recursive Delete(!): Allow ALL subpages to be deleted when deleting a page"? In TYPO3 7.6 and 8.7 this definitely is not a general problem (you chose 7 as TYPO3 version for this bug)..</p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=3707032018-08-13T18:17:00ZSybille Peterssypets@gmx.de
<ul><li><strong>Status</strong> changed from <i>Needs Feedback</i> to <i>Closed</i></li></ul><p>@Stephan Yes, I did, but as I have been unable to reproduce this now, I will close.</p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4192592020-03-16T17:02:42ZSybille Peterssypets@gmx.de
<ul><li><strong>Subject</strong> changed from <i>Trying to delete pages with subpages as admin gives error: "Attempt to delete page without permissions"</i> to <i>Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"</i></li><li><strong>Status</strong> changed from <i>Closed</i> to <i>New</i></li><li><strong>TYPO3 Version</strong> changed from <i>7</i> to <i>9</i></li></ul><p>I still get this problem and I can reproduce it now: It happens when trying to delete pages with translations pages.</p>
<p>Tested with current 9.5.</p>
<p>Problem occurs if deletion is performed in Backend as system user.</p>
<pre>
I get the error message: "Attempt to delete page without permissions"
</pre>
<p>I have set the recursive delete option so that is not the problem.</p>
<ul>
<li>delete page without translation: no error</li>
<li>delete page with translation (and no subpages): no error</li>
<li>delete page without translation + subpage without translation: no error</li>
<li>delete page with subpage with translation: ERROR</li>
</ul> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4192602020-03-16T17:05:53ZSybille Peterssypets@gmx.de
<ul></ul><p>I can also reproduce this with latest master (10.4-dev)</p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4192622020-03-16T17:24:07ZSybille Peterssypets@gmx.de
<ul></ul><p>The problem seems to be in the order deletion of pages with translations is performed in DataHandler::deleteRecord()</p>
<pre><code class="php syntaxhl" data-language="php"><span class="nc">GeneralUtility</span><span class="o">::</span><span class="nf">makeInstance</span><span class="p">(</span><span class="nc">ConnectionPool</span><span class="o">::</span><span class="n">class</span><span class="p">)</span>
<span class="o">-></span><span class="nf">getConnectionForTable</span><span class="p">(</span><span class="nv">$table</span><span class="p">)</span>
<span class="o">-></span><span class="nb">delete</span><span class="p">(</span><span class="nv">$table</span><span class="p">,</span> <span class="p">[</span><span class="s1">'uid'</span> <span class="o">=></span> <span class="p">(</span><span class="n">int</span><span class="p">)</span><span class="nv">$uid</span><span class="p">]);</span>
<span class="nv">$this</span><span class="o">-></span><span class="n">deletedRecords</span><span class="p">[</span><span class="nv">$table</span><span class="p">][]</span> <span class="o">=</span> <span class="p">(</span><span class="n">int</span><span class="p">)</span><span class="nv">$uid</span><span class="p">;</span>
<span class="nv">$this</span><span class="o">-></span><span class="nf">deleteL10nOverlayRecords</span><span class="p">(</span><span class="nv">$table</span><span class="p">,</span> <span class="nv">$uid</span><span class="p">);</span>
</code></pre>
<p>which results in the original page already being deleted when canDeletePage is called:</p>
<pre><code class="php syntaxhl" data-language="php"><span class="nc">DataHandler</span><span class="o">::</span><span class="nf">canDeletePage</span><span class="p">(</span><span class="nv">$uid</span><span class="p">)</span>
<span class="p">{</span>
<span class="nv">$uid</span> <span class="o">=</span> <span class="p">(</span><span class="n">int</span><span class="p">)</span><span class="nv">$uid</span><span class="p">;</span>
<span class="nv">$isTranslatedPage</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="c1">// If we may at all delete this page</span>
<span class="c1">// If this is a page translation, do the check against the perms_* of the default page</span>
<span class="c1">// Because it is currently only deleting the translation</span>
<span class="nv">$defaultLanguagePageId</span> <span class="o">=</span> <span class="nv">$this</span><span class="o">-></span><span class="nf">getDefaultLanguagePageId</span><span class="p">(</span><span class="nv">$uid</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$defaultLanguagePageId</span> <span class="o">!==</span> <span class="nv">$uid</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nv">$this</span><span class="o">-></span><span class="nf">doesRecordExist</span><span class="p">(</span><span class="s1">'pages'</span><span class="p">,</span> <span class="p">(</span><span class="n">int</span><span class="p">)</span><span class="nv">$defaultLanguagePageId</span><span class="p">,</span> <span class="s1">'delete'</span><span class="p">))</span> <span class="p">{</span>
<span class="nv">$isTranslatedPage</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="k">return</span> <span class="s1">'Attempt to delete page without permissions'</span><span class="p">;</span>
<span class="p">}</span>
</code></pre>
<p>The problem happens when this function is called for the translated page. In that case, the original page was already deleted (deleted=1) and the function doesRecordExist() will fail.</p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4193442020-03-17T14:28:03ZGerrit Code Review
<ul><li><strong>Status</strong> changed from <i>New</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/c/Packages/TYPO3.CMS/+/63757">https://review.typo3.org/c/Packages/TYPO3.CMS/+/63757</a></p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4200392020-03-23T13:11:47ZGerrit Code Review
<ul></ul><p>Patch set 2 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/c/Packages/TYPO3.CMS/+/63757">https://review.typo3.org/c/Packages/TYPO3.CMS/+/63757</a></p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4200682020-03-23T14:41:29ZGerrit Code Review
<ul></ul><p>Patch set 3 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/c/Packages/TYPO3.CMS/+/63757">https://review.typo3.org/c/Packages/TYPO3.CMS/+/63757</a></p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4200762020-03-23T14:55:53ZGerrit Code Review
<ul></ul><p>Patch set 4 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/c/Packages/TYPO3.CMS/+/63757">https://review.typo3.org/c/Packages/TYPO3.CMS/+/63757</a></p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4200912020-03-23T15:56:55ZGerrit Code Review
<ul></ul><p>Patch set 5 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/c/Packages/TYPO3.CMS/+/63757">https://review.typo3.org/c/Packages/TYPO3.CMS/+/63757</a></p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4200992020-03-23T16:06:34ZGerrit Code Review
<ul></ul><p>Patch set 6 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/c/Packages/TYPO3.CMS/+/63757">https://review.typo3.org/c/Packages/TYPO3.CMS/+/63757</a></p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4204142020-03-24T20:56:27ZSybille Peterssypets@gmx.de
<ul><li><strong>Category</strong> changed from <i>Backend API</i> to <i>DataHandler aka TCEmain</i></li></ul> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4204212020-03-24T21:22:21ZGerrit Code Review
<ul></ul><p>Patch set 1 for branch <strong>9.5</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/c/Packages/TYPO3.CMS/+/63871">https://review.typo3.org/c/Packages/TYPO3.CMS/+/63871</a></p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4204222020-03-24T21:30:04ZSybille Peterssypets@gmx.de
<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] Fix order of deleting page translations in DataHandler If a page translation exists, it..." href="http://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/02e81aebef92599e9c30b427e127c7f2c7fae9ee">02e81aebef92599e9c30b427e127c7f2c7fae9ee</a>.</p> TYPO3 Core - Bug #85824: Trying to delete page with subpages with translations as admin gives error: "Attempt to delete page without permissions"http://forge.typo3.org/issues/85824?journal_id=4213782020-04-01T21:14:30ZBenni Mackbenni@typo3.org
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul>