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

Copied content elements pasted with wrong sorting value #422

Closed
dariuskapitza opened this issue Jun 22, 2023 · 4 comments · Fixed by #484
Closed

Copied content elements pasted with wrong sorting value #422

dariuskapitza opened this issue Jun 22, 2023 · 4 comments · Fixed by #484

Comments

@dariuskapitza
Copy link

Hello,

we have upgraded two projects from TYPO3 v10 to TYPO3 v11 and migrated fron Gridelements to b13 Container. Both projects have the described problem below:

The migration was done with the gridtocontainer extension.
Migrated with gridtocontainer:migrateall command executions and cleanups in the database as described on https://docs.typo3.org/p/sbublies/gridtocontainer/main/en-us/Usage/Index.html and https://docs.typo3.org/p/sbublies/gridtocontainer/main/en-us/CommandReference/Index.html

We have executed the container:sorting command (with --apply) mentioned in the issue
#415 and executed referenceindex:update.

Now there is a problem pasting a (simple) content element like header into a page row (not into a container) when migrated container elements are on the target page. The copied element is placed somewhere else on the page, mostly on the top but not always.
Pasting on new pages with new created container elements seems to be fine, but maybe this is randomly correct.

More details / Environment:

  • TYPO3 11.5.28
  • PHP 8.1
  • container 2.2.3
@achimfritz
Copy link
Contributor

Hi @dariuskapitza , can you describe how this is reproduceable on a TYPO3/container Vaniila Instance?, i know nothing about any gridtocontainer migrations ...

@Gernott
Copy link

Gernott commented Feb 21, 2024

We have exactly the same problem. We can reproduce it in one of our project.
I can send you a db-export of pages and tt_content.

@Gernott
Copy link

Gernott commented Feb 23, 2024

container-sorting.tar.gz
Here is a ddev project with data to reproduce it fast:

  • extract container-sorting.tar.gz
  • ddev start
  • This automatically makes a composer install and imports the db
  • The BE-Login Data is in the READ.ME
  • Go to page module, page "Katastrophenschutz"
  • Drag&drop the last Content "Einmal Berge und zurück..." up before "Blackout"
  • After reloading the Backend: "Einmal Berge und zurück..." is at the bottom again :(

@achimfritz
Copy link
Contributor

ok, got it, the problem here is that "global" sorting on this page is "wrong"

MariaDB [db]> select uid,tx_container_parent,CType,header,sorting,colPos,pid from tt_content order by sorting;
+------+---------------------+--------------+-----------------------------+---------+--------+-----+
| uid  | tx_container_parent | CType        | header                      | sorting | colPos | pid |
+------+---------------------+--------------+-----------------------------+---------+--------+-----+
| 2560 |                   0 | container-12 |                             |       4 |      0 | 255 |
| 2559 |                   0 | container-12 | Blackout                    |       8 |      0 | 255 |
| 2558 |                2559 | mask_image   |                             |      16 |     10 | 255 |
| 2556 |                2560 | mask_text    |                             |      64 |     10 | 255 |
| 2555 |                   0 | container-12 | Einmal Berge und zurück...  |      66 |      0 | 255 |
| 2554 |                2555 | mask_text    |                             |      75 |     10 | 255 |
+------+---------------------+--------------+-----------------------------+---------+--------+-----+

should be:

MariaDB [db]> select uid,tx_container_parent,CType,header,sorting,colPos,pid from tt_content order by sorting;
+------+---------------------+-----------+-----------------------------+---------+--------+-----+
| uid  | tx_container_parent | CType     | header                      | sorting | colPos | pid |
+------+---------------------+-----------+-----------------------------+---------+--------+-----+
| 2560 |                   0 | container-12  |                             |       4 |      0 |   2 |
| 2556 |                2560 | mask_text    |                             |      64 |    200 |   2 |
| 2559 |                   0 | container-12  | Blackout                    |      65 |      0 |   2 |
| 2558 |                2559 | mask_image    |                             |     321 |    200 |   2 |
| 2555 |                   0 | container-12  | Einmal Berge und zurück...  |     578 |      0 |   2 |
| 2554 |                2555 | mask_text    |                             |     587 |    200 |   2 |
+------+---------------------+-----------+-----------------------------+---------+--------+-----+

result can be achieved by

        $cmdmap = [
            'tt_content' => [
                2559 => [
                    'move' => -2560
                ]
            ]
        ];

container sorting command only fixes sorting of container children.
i will have an other look on it.

achimfritz pushed a commit that referenced this issue Mar 2, 2024
achimfritz pushed a commit that referenced this issue Mar 2, 2024
achimfritz pushed a commit that referenced this issue Mar 4, 2024
achimfritz pushed a commit that referenced this issue Mar 6, 2024
achimfritz pushed a commit that referenced this issue Mar 6, 2024
achimfritz pushed a commit that referenced this issue Mar 6, 2024
achimfritz pushed a commit that referenced this issue Mar 12, 2024
achimfritz pushed a commit that referenced this issue Mar 13, 2024
This command maybe helpful when migrating to EXT:container
from any other grid extension and have inconsistent sorting
on page, e.g. container is sorted before previous
container child

fixes: #422
achimfritz pushed a commit that referenced this issue Mar 28, 2024
This command maybe helpful when migrating to EXT:container
from any other grid extension and have inconsistent sorting
on page, e.g. container is sorted before previous
container child

fixes: #422
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 a pull request may close this issue.

3 participants