KunstmaanBundlesCMS icon indicating copy to clipboard operation
KunstmaanBundlesCMS copied to clipboard

[MediaBundle] Treeview incorrect

Open stanv923 opened this issue 10 months ago • 1 comments

I was reordering media folders in the CMS and when i move a specific folder to the root folder, the treeview on the left side shows only the folder contents of that specific folder. When i click media again i see the root folder again in the treeview but the subfolder is missing. In the content view (middle of the screen) the folder does appear. So the treeview and the contents view differ. When i look in the database i can see that the there are many rows in the kuma_folders table that have negative lft and rgt values.

I have also tried:

  • To run a migration to recover the gedmo tree with the recover function on the repository: https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/src/Tree/Entity/Repository/NestedTreeRepository.php#L995 but this did not work
  • To run a migration with the rebuildTree function on the kunstmaan folder repository: https://github.com/Kunstmaan/KunstmaanBundlesCMS/blob/6.4/src/Kunstmaan/MediaBundle/Repository/FolderRepository.php#L270 this works but i will lose the complete structure of the media collection (which is quite large, and would be a lot of work the reorganize completely).

stanv923 avatar Apr 02 '24 09:04 stanv923

Possibly related, I've literally just run into this error: Kunstmaan\MenuBundle\Twig\MenuTwigExtension::getMenu(): Return value must be of type string, array returned In vendor/gedmo/doctrine-extensions/src/Tree/RepositoryUtils::buildTree() we can see the following comment on line 118:

// If you don't want any html output it will return the nested array

The twig extension was changed in commit c48c51508ef9ee6cfc7fc88616a35e5c21f0f81f on 24/03/2024 It (obviously) works when I change the return type to string|array

delboy1978uk avatar Apr 02 '24 11:04 delboy1978uk