Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only check the first record to be restored #6665

Merged
merged 4 commits into from Dec 27, 2023

Conversation

aschempp
Copy link
Member

I noticed a bug in my PR #6642

The undo table will contain data of a record and all its child records. However, we cannot check permissions on all child records, they will most likely fail because their parent is not present. We can only check the actualy record and have to assume its children can be added as well.

The actual DC_Table::undo() will check each record to be restored, but the operation callback cannot do that upfront.

@aschempp aschempp added the bug label Dec 26, 2023
@aschempp aschempp added this to the 5.3 milestone Dec 26, 2023
@aschempp aschempp requested a review from a team December 26, 2023 22:16
@aschempp aschempp self-assigned this Dec 26, 2023
Copy link
Member

@Toflar Toflar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a comment and saying that this case is covered in DC_Table::undo() - otherwise we'll try to re-implement it again because it seems to be quite obvious to try to do that in the first place.

@aschempp
Copy link
Member Author

added in afc89fb

Toflar
Toflar previously approved these changes Dec 27, 2023
leofeyer
leofeyer previously approved these changes Dec 27, 2023
@leofeyer leofeyer changed the title Only check first record to be restored Only check the first record to be restored Dec 27, 2023
@leofeyer leofeyer enabled auto-merge (squash) December 27, 2023 14:35
@leofeyer
Copy link
Member

Thank you @aschempp.

@leofeyer leofeyer merged commit 3eba2e9 into contao:5.x Dec 27, 2023
16 checks passed
@aschempp aschempp deleted the fix/undo-permissions branch December 27, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants