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

Move Item after Container failed #458

Open
Ranunzel opened this issue Nov 3, 2023 · 12 comments
Open

Move Item after Container failed #458

Ranunzel opened this issue Nov 3, 2023 · 12 comments
Assignees

Comments

@Ranunzel
Copy link

Ranunzel commented Nov 3, 2023

Its not possible to move a Content Element after a B13 Container

Latest version b13 Container
TYPO3: 12,4,7

The Issue happens in:
Classes/Hooks/Datahandler/CommandMapBeforeStartHook.html Line 145.
The Fix is:
(add after line 145)
if ((int)$value['update']['tx_container_parent'] > 0) {
$target = $this->containerService->getAfterContainerElementTarget($container);
} else {
continue;
}
garbast@cfdb180

@koehnlein
Copy link

koehnlein commented Nov 15, 2023

Did you execute typo3 container:sorting --apply ?

@treknuts
Copy link

Did you execute typo3 container:sorting --apply ?

Recently switched from gridlelements to containers v2.3.1 on a Typo3 10.4 installation and have users experiencing the same issue. How often does this command need to be run and where can I find documentation on what it does? Also, I have the container_migratesorting upgrade task. Does running the upgrade wizard fix this? Thanks.

@koehnlein
Copy link

Do you still have gridelements installed? Looks like this could cause conflicts #475 (comment)

@treknuts
Copy link

Installed but deactivated. Do I need to fully uninstall it? I inherited a legacy site from many years ago and we use the Extension Manager.

@koehnlein
Copy link

As far as I understand it, you need to run typo3 container:sorting --apply only once when migrating to EXT:container 2.0

Except you have any other script or tool, that manipulates the tt_content.sorting field. If you can ensure, it's not EXT:gridelements which manipulates the field, I'm pretty sure there is any other script or extension in your project, that does it.

@DanielSiepmann
Copy link

DanielSiepmann commented Jun 18, 2024

This issue looks like it got duplicated by #500.

We encounter the same issue.

I guess this bug got introduced via 149 with a1cc4de.
With the following explanation:

* element after a container
 * old: -uid of container is used (leeds to broken sorting)
 * new: -uid of last child in containers last column is used

I don't know why it should lead to broken sorting, right now it seems the other way around. And the proposed fix also seems to revert that change.
So this bug seems to be explicitly a fix for something else, but I can't get my head around it.

I will now test the suggestion to execute the command (multiple times as the instance has nested containers). That might solve the issue as the last element then might have a higher sorting value which would than be used for pasting.

@DanielSiepmann
Copy link

DanielSiepmann commented Jun 19, 2024

Executing the command didn't solve the issue.

There is a functional test ensuring that moving properly works. So I guess the command is for some reason unable to properly fix the broken sorting in our instance.

@achimfritz
Copy link
Contributor

@DanielSiepmann it would be helpful to provide a simple dump of the corresponding tt_content records, do reproduce the bug on a vanilla TYPO3 instance

@DanielSiepmann
Copy link

A colleague of mine will further investigate.
We will try to come up with a proper cleaned dump if we can't figure it out.

@extcode
Copy link
Contributor

extcode commented Jun 25, 2024

I don't know if this fits the case exactly. I once analyzed this for a case in one of our projects. We were unable to move a certain content element before the previous content element in the project.
Unfortunately, the commands to clean up the sorting did not solve the problem, because in the case of nested containers, the $lastChild of the current container is not correctly retrieved.
I'll provide a PR soon.

@garbast
Copy link
Contributor

garbast commented Oct 2, 2024

This still happens. I have a similar problem in TYPO3 11.x and EXT:container 2.2.4 currently.

  • create a container with a child
  • create an element after it
  • the element appears on top of the page.

Whats even worth is. I executed the sorting command. After the sorting it worked until a new child got created. After the creation of any new child on the page, the next element outside of the container went directly on top of the page.

Is there a permanent solution for that? I cant execute the command every time a new child was created.

@achimfritz
Copy link
Contributor

Hi @garbast , i cannot reproduce this (on a vanilla TYPO3 with EXT:container_examples) (TYPO3 11, container:2.2.4, PHP 8.1)

Screenshot 2024-10-30 at 19 00 39

(i have clicked the "+ Content" Button, to create element after container, right?)

can you give and min. sql dump of the tt_content table, before (and after?) the new element after the container is created?

(any other extensions installed?)

@achimfritz achimfritz self-assigned this Oct 30, 2024
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

7 participants