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

Drag and drop of elements into containers kicks the colPos of the element #297

Closed
HorstBaumann opened this issue Sep 7, 2022 · 14 comments
Closed

Comments

@HorstBaumann
Copy link

System:
TYPO3 11.5.15 - fresh installation
container 2.0.2

Description:
After updating container from 1.6.1 to 2.* it is no longe possible to move an element from outside a container into a container or
vice versa. The element loses its colPos.
When I downgrade to container 1.6.1 everything works well.

Error:
These fields of record xx in table "tt_content" have not been saved correctly: colPos! The values might have changed due to type casting of the database.

2022-09-07_13h51_19

@achimfritz
Copy link
Contributor

@HorstBaumann mh, cannot reproduce, did you run the container-sorting migration? bin/typo3cms container:sorting 0 if you have already content elements in the database?

@HorstBaumann
Copy link
Author

no. how can i run this ? (no composer setup)

@achimfritz
Copy link
Contributor

achimfritz commented Sep 7, 2022

use upgrade wizard, or use cli bin/typo3 container:sorting 0 (or vendor/bin/typo3 container:sorting 0

@HorstBaumann
Copy link
Author

OK, i used the upgrade wizard. But the problem remains.

php: 8.1.7

@achimfritz
Copy link
Contributor

What database do you running, colPos is an integer field in Database, so the error you get looks like we give colPos as a string to the datahandler.
I try to reproduce.

@HorstBaumann
Copy link
Author

HorstBaumann commented Sep 7, 2022

colPos is correctly set to: int(10) unsigned [0]

I discovered, that after moving the element, the uid of the new parent-container is wrongly written to the colPos-column.
and the column "tx_container_parent" does not change.

example:
element E was build inside container A (uid11 with colPos set to 201)
element E has colPos = 201 and tx_container_parent = 11

now i move element E to a new container B (uid12)
-the backend shows me the error-
and element E now has colPos = 12 and tx_container_parent = 11

(when i drop it directly to the page (not inside a container-element) the colPos is correctly updated to 0, but tx_container_parent stays on the uid of the last surrounding container - which causes the backend to put the element to the "unused-area")

I think there must be an error by updating colPos and tx_container_parent while dropping the contained element to the new destination.

grafik

@achimfritz
Copy link
Contributor

@HorstBaumann sorry, cannot reproduce... Can you give me more Information, would be cool to have your Container-Configuration, your Backend-Layout, and a dump of tt_content before moving the element

@Adan0s
Copy link

Adan0s commented Sep 12, 2022

I'm having the same problem with version 2.0.4. Never used the 1.x branch as I just migrated a week ago from gridelements to container. I ran the upgrade wizard to fix the sorting multiple times.

image

EDIT: Figured it out. I'm using the extension "paste_reference" v1.0.2 and somehow in interferes with the container colPos. The second I deactivated the extension everything is working again.

@HorstBaumann
Copy link
Author

HorstBaumann commented Sep 12, 2022

@Adan0s very good point ! - I also use "paste_reference 2.0.0" - which seems to cause the problem in combination with container (higher than 1.6.1)

@achimfritz
Copy link
Contributor

the EXT:paste_reference uses a mix of data and cmd when moving elements like

data = [
    'tt_content' => [
        'colPos' => 10,
        'sys_language_uid' => 0
    ]
];
cmd = [
    'tt_content' => [
        1 => ['move' => 139]
    ]
];

support for this mix has been removed in 2.0
also the core has removed this mix (because of Problems in WS)
s. https://forge.typo3.org/projects/typo3cms-core/repository/1749/revisions/c1be5540b20421fdfa295a1323b663f3189a41d7 and https://forge.typo3.org/issues/92849

the EXT:paste_reference datahandler call in the JS should change to:

data = null;
cmd = [
  'tt_content' => [
      1 => [
          'move' => [
              'action' => 'paste',
              'target' => 139,
              'update' => [
                  'colPos' => 10,
                  'sys_language_uid' => 0
              ]
          ]
      ]
  ]
];

i will provide an PR

@achimfritz
Copy link
Contributor

@CMS-Internetsolutions
Copy link

Shortly to the info, the extension "paste_reference" caused with me also the errors indicated above.

@achimfritz
Copy link
Contributor

should be fixed using current Version of EXT:past_reference (>=2.0.1)

@mikestreety
Copy link

mikestreety commented Nov 21, 2022

As an update, a new version of paste reference (1.0.3) has been released to address and resolve this issue in TYPO3 v10

Kephson/paste_reference@2c8dfea

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

No branches or pull requests

5 participants