getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.54k stars 1.41k forks source link

Grav subpage issues : replicated fault (possibly flex object) #3365

Closed spamhater-grav closed 3 years ago

spamhater-grav commented 3 years ago

Had a couple of people identify an issue of strange folder numbering prefixing on the forum.

I now been able to identify a couple of linked issues

If you create a numbered sub page / folder off the root under the admin panel, all is ok (due to the existing pages (01.home / 02.typography ) this look ok.

If you then try and create a child to the subfolder / page, when the 'add page' or 'add folder' is displayed selecting the sub folder as a parent, it doesnt update correctly and will still state / display "root"

If you then 'enable foldering numbering' and the save the page. It will display the page with a prefix of 999999.pagename , and this is displayed in the ordering. If you then press the save button, it increments the folder name by 1 everytime.

It doesnt happen if there is a previous or manually created or renamed folder with the correct number (01) Any further depth down with also produce this issue.

You see the result in the screen recording, a few users have noticed and seem to be related to the recent flex-box updates.

All tested and issue is repeatable on a clean install of grav and users have queried the issue on the community forum.

https://user-images.githubusercontent.com/84087968/119056173-2629ce00-b9c2-11eb-90d2-bff4bb22e908.mp4

Many thanks

pamtbaau commented 3 years ago

Is indeed reproducible. Happens since Grav Core + Admin Plugin v1.7.8

Possibly caused by "Optimized saving visible/ordered pages when there are a lot of siblings #3231" on Grav v1.7.8 ? With commit: https://github.com/getgrav/grav/commit/27aff76b206cebc007bcea76b95bc48aba547d94

Steps to reproduce:

  1. $ wget https://getgrav.org/download/core/grav-admin/1.7.8 .
  2. $ unzip 1.7.8 -d .
  3. Login to site and go to admin/pages/home to open 'Home' page.
  4. Click +Add
  5. In modal form, enter name 'Child' and leave 'Parent page' as 'Home'
  6. Click Continue
  7. Click Enable for field 'Folder Numeric Prefix'
  8. Click Save
  9. Field 'Sortable Pages' will show 999999.Child
  10. Repeat step 8.
    • Field 'Sortable Pages' will show 1000000.Child
    • Etc.
mahagr commented 3 years ago

The first issue is duplicate of #2136 (parent not changing).

mahagr commented 3 years ago

@spamhater-grav @pamtbaau Can you test the fix?

pamtbaau commented 3 years ago

Using Grav development branch:

  1. $ git clone https://github.com/getgrav/grav -b develop .
  2. $ bin/grav install
  3. $ bin/gpm install admin
  4. Running script as mentioned above
    • Field 'Sortable Pages' shows 1.Child
    • Saving again still shows 1.Child

Ergo, faulty behaviour shown before can no longer be reproduced. Seems you have fixed it...