Bug #30229

Error when deleting a Page with translation

Added by Maik Nergert over 8 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Pagetree
Target version:
-
Start date:
2011-09-23
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

everytime a user deletes pages with translated content on it, you get the following error message:
4.4.11:

1: Attempt to delete record without delete-permissions. [ERROR: Record could not be fetched.]

4.5.6/4.6.0:
Exception
[1.3.-1]: Attempt to delete record without delete-permissions. [ERROR: Record could not be fetched.]

It's only a message, the page+content will be deleted and disappear in the page tree. Each translation produces 1 message.

I have reproduced the error on different typo3 versions. 4.4.11 (fresh installation,windows), 4.5.6 (existing installation,linux), 4.5.6 (fresh installation,linux), 4.6.0beta3 (fresh installation,windows).

How to reproduce?
- take a fresh or existing typo3 installation
- setup your site to allow localization
- create a testuser with all access rights (exept admin)
- create a new page and add some sample content + alternative page language
- use the 'localize to' button in the list view to translate the sample content
- grant the testuser ownership of the new page
- switch to testuser and delete the newly created page

At this point, you should see the error message and a record in the log.
The message doesn't appear when working as admin.

Regards
Maik

patch-30229.diff View (507 Bytes) Claudio Mettler, 2012-07-24 14:56

30229-4_5_v2.diff View (1.21 KB) Michael Voehringer, 2014-08-20 12:03

patch-30229-master.diff View (1.46 KB) Michael Voehringer, 2014-08-20 17:38


Related issues

Related to TYPO3 Core - Bug #85099: Attempt to delete without permission - error message shows up, but action works On Hold 2018-05-28

History

#1 Updated by René Häfliger over 8 years ago

  • Target version set to 4.5.9

Same issue here.
Tested in Version 4.5.3 and 4.5.8 (php 5.3) ...

As I have seen in the file t3lib/class.t3lib_userauthgroup.php ond line 608 the record (translated tt_content) should be fetched for checking access permissions, but is already deleted...

I'm wondering why this is no bigger issue. Hope it's not kind of misconfiguration..

#2 Updated by Ernesto Baschny about 8 years ago

  • Target version changed from 4.5.9 to 4.5.12

#3 Updated by Claudio Mettler over 7 years ago

attached is a patch against 4.5.17 that fixes the problem. i am not sure if the patch format is right.

#4 Updated by Maik Nergert over 7 years ago

Thanks Claudio, this patch works for me.

#5 Updated by Gerrit Code Review over 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/14265

#6 Updated by Benni Mack about 7 years ago

  • Status changed from Under Review to Needs Feedback

Claudio Mettler wrote:

attached is a patch against 4.5.17 that fixes the problem. i am not sure if the patch format is right.

Hey Claudio,

I actually tried the same behaviour but cannot reproduce this error message.

This is what I have:

  • 4.5.23-dev running
  • I create a page in the default language, I create a content element on it
  • I create a translation of the page, and then I translate the content element

The log shows this

06:08:47 admin@LIVE DB Delete
Record 'Testpage' (pages:73) was deleted from page 'Home' (1)
Record 'Testpage DA' (pages_language_overlay:2) was deleted from page 'Testpage' (73)
Record '[Translate to Dansk:] Text+Images EN' (tt_content:254) was deleted from page 'Testpage' (73)
Record 'Text+Images EN' (tt_content:253) was deleted from page 'Testpage' (73)
Record '[Translate to Dansk:] Text+Images EN' (tt_content:254) was deleted from page 'Testpage' (73)

Everything fine then, right? Also: Does this issue happen to you on newer installations (4.6+) as well?

#7 Updated by Maik Nergert about 7 years ago

Hi Benjamin,

did you try to delete the page as non-admin?

#8 Updated by Ralf Merz almost 7 years ago

Hi,

i can confirm that this bug still exists in TYPO3 6.0.2. As an non-admin, but an editor having localization rights, i have the following behavior:
- a page has been created an a content element "text w. image" has been created and localized
- in the pagetree i choose to copy the page and insert it after an existing page
Until now... no problems.
- Now i choose the click menu to delete the page.
=> the error message as described in the issue appears:
Exception
[1.3.-1]: Attempt to delete record without delete-permissions. [ERROR: Record could not be fetched.] [1.3.-1]: Attempt to delete record without delete-permissions. [ERROR: Record could not be fetched.]

The page tree does not refresh by itself. But if i do refresh I can see that the deleted page is no longer in the page tree, and i also can not open it in frontend. In the database the "deleted" flag is set.

Hope that helps to fix this.

Kind regards
Ralf

#9 Updated by Mario Rossi almost 7 years ago

Bug exists also in 4.7.12

#10 Updated by Michael Stucki almost 7 years ago

Hi Mario!

Bug exists also in 4.7.12

Does the patch from above fix the problem?

Greetings, Michael

#11 Updated by Alexander Opitz over 6 years ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (4.5.18)
  • Is Regression set to No

No feedback for over 90 days.

#12 Updated by Daniel Wagner about 6 years ago

Hi, I can confirm that this problem still exists in 4.5.32.

#13 Updated by Frédéric Ollivier about 6 years ago

Hello all

Sadly, this bug s still here in 4.5.32.

Hope someone will fix that soon

BTW thanks for all, TYPO3 people!

#14 Updated by Michael Voehringer over 5 years ago

I can confirm that the bug still exists in 4.5.35 and that the updated patch will fix this issue for 4.5.

Can someone pleas reopen this bug?

#15 Updated by Michael Voehringer over 5 years ago

Bug also exists in 6.2 and master branch, see attached patch.

#16 Updated by Sybille Peters almost 5 years ago

This bug occurs on a production system with 6.2.11

This is reproducable with the introduction package, using the 6.2.12-dev version from git (pulled at Di 14. Apr 16:48:14 CEST 2015).

I could very easily reproduce it following the directions from Maik Nergert (see above).

Why was this bug closed? A patch made it to the review server but never into a release?

Again, to reproduce you need to
- create the page / content as admin user
- create a translation for the page and content
- then set the ownership to a "normal" user ("advanced_editor" in introduction package will work)
- switch to "advanced_editor" and then try to delete the page

When using the patch by Michael Voehringer (submitted 8 months ago) which patches the function deleteSpecificPage in DataHandler.php, the error message does not occur. But I'm not sure if this is the ideal solution. Extra sql requests are submitted (in getRecord), which are not really necessary and I think one should look why getRecord returns false in the first place. It seems, the translated tt_content has already been deleted.

When debugging this, getRecord returns false for the translated tt_content.

#17 Updated by Jigal van Hemert almost 5 years ago

  • Status changed from Closed to New
  • Priority changed from Won't have this time to Should have

#18 Updated by Alexander Opitz almost 5 years ago

  • Target version set to next-patchlevel

This issue was closed by me, as nobody responded to questions. And your reopen request helped here.

@Michael Voehringer

Can you push your patch for master to gerrit so it will be reviewed? See http://wiki.typo3.org/CWT for help.

#19 Updated by Gerrit Code Review almost 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40186

#20 Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40186

#21 Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40186

#22 Updated by Gerrit Code Review almost 5 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40186

#23 Updated by Gerrit Code Review over 4 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40186

#24 Updated by Mathias Schreiber over 4 years ago

  • Target version deleted (next-patchlevel)

#25 Updated by Morton Jonuschat about 4 years ago

  • Status changed from Under Review to Closed

As the issue is rather old and nobody is able to reproduce it on the current 6.2/7.6/8.0-dev versions I'll close this one.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

#26 Updated by Ralf Merz about 2 years ago

  • Priority changed from Should have to Must have
  • TYPO3 Version changed from 4.5 to 8
  • PHP Version changed from 5.2 to 7.0

Hi guys,

I'm sorry I have to re-open this issue again.
We have this problem again in v8.7.10 and 8.7.11 and the pages are in 3 languages (default and 2 others).

If an editor deletes a page, we get the red flashMessage

1: Attempt to delete record without delete-permissions

multiple times for elements that are on the pages (in all languages). So for example: "default" has 2 text elements, which are localized (translated) into the two other languages each.
If I delete the page I get the error 3 times.
When I add a Text element and translate it too, deleting the page results in 5 times this error message.
Then I discovered:
When I delete a content element, and also the translations (the popup says that the 2 translations will be deleted, too), and do this as long as the page is empty (no more content elements on it), I can delete the page without errors.

Maybe someone can check this and confirm.

Kind regards
Ralf

#27 Updated by Ralf Merz almost 2 years ago

  • Related to Bug #85099: Attempt to delete without permission - error message shows up, but action works added

Also available in: Atom PDF