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

Fixing Template Editing bugs #28128

Merged

Conversation

freddyDOTCMS
Copy link
Contributor

@freddyDOTCMS freddyDOTCMS commented Apr 2, 2024

Before we were using this update statement

https://github.com/dotCMS/core/pull/28128/files#diff-926e9e9e22e2c282fa305bbe50022e93d9d91d6b83a5c33c8e29cacde4a0b52cL1266

to update the MultiTree, we were running this query for each UUID that need to be updated for example if we had a Layout with 2 instance of the same Containers (1 and 2) and we move the last one to the top we need to run the follow queries:

UPDATE multi_tree set relation_type = 1 WHERE parent1 in (...) AND parent2 = 'container ID' AND relation_type = 2
UPDATE multi_tree set relation_type = 2 WHERE parent1 in (...) AND parent2 = 'container ID' AND relation_type = 1

so it can cause that all the MultiTree finish with the same relation_type

Also we have two Resource where the Layout can be changed but this two Ed points are not reusing code.

Proposed Changes

  • We need to reuse the same code between the Two End points

https://github.com/dotCMS/core/pull/28128/files#diff-448b3630547f743e0d556752c2e68b797b03e9c4b9d7e238c84889274435635eR338

https://github.com/dotCMS/core/pull/28128/files#diff-c74cebd0e6210e5d55c1e765543514a52f84f3f312277ddd3c80d21680fb545cR375

  • Also we need to mark the MultiTree that are going to be updated after the Layout changes

https://github.com/dotCMS/core/pull/28128/files#diff-926e9e9e22e2c282fa305bbe50022e93d9d91d6b83a5c33c8e29cacde4a0b52cR1305-R1311

here I explain exactly what I am doing

https://github.com/dotCMS/core/pull/28128/files#diff-926e9e9e22e2c282fa305bbe50022e93d9d91d6b83a5c33c8e29cacde4a0b52cR1305-R1311

@freddyDOTCMS freddyDOTCMS marked this pull request as ready for review April 12, 2024 15:41
@dsilvam dsilvam enabled auto-merge April 18, 2024 21:58
@dsilvam dsilvam added this pull request to the merge queue Apr 22, 2024
Merged via the queue into master with commit dda1860 Apr 22, 2024
26 checks passed
@dsilvam dsilvam deleted the issue-27816-Content-Displacement-Bug-when-Editing-Template branch April 22, 2024 15:45
@dsilvam dsilvam linked an issue Apr 22, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Content Displacement Bug when Editing Template
3 participants