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

Sortable Pages stop working now [Grav v1.3.0 / Admin v1.5.0] #1574

Closed
ash0080 opened this issue Jul 17, 2017 · 27 comments
Closed

Sortable Pages stop working now [Grav v1.3.0 / Admin v1.5.0] #1574

ash0080 opened this issue Jul 17, 2017 · 27 comments
Labels

Comments

@ash0080
Copy link
Contributor

ash0080 commented Jul 17, 2017

Can not save the order

@ash0080
Copy link
Contributor Author

ash0080 commented Jul 17, 2017

Noticed that the folder numeric prefix is still working. means changing the order in page editor will rename the folders, but Grav can't show them as expected. both on frontend and backend

@timrobbings
Copy link
Contributor

I am also seeing this behaviour after updating to Grav v1.3.0/Admin v1.5.0.

I think I can see the problem, see this PR for my proposed fix.

Although admittedly, I have a fairly rudimentary understanding of the codebase so people can let me know if I've missed something!

@MattAppleton
Copy link
Contributor

Second this, page ordering was working with rc05, newest Admin seems to break it, have tried clearing cache and going again but not working.

@ash0080
Copy link
Contributor Author

ash0080 commented Jul 17, 2017

@timrobbings It works, Great!

@rhukster
Copy link
Member

merged, will release later tonight or tomorrow

@rhukster rhukster added the fixed label Jul 17, 2017
@ash0080
Copy link
Contributor Author

ash0080 commented Jul 18, 2017

@rhukster wait, seems still has problem, the fix doesn't work after touching the page in editor again.

@rhukster
Copy link
Member

if you can provide a PR with a fix that would be appreciated. I don't have any access right now to a linux system that exhibits this behavior.

@timrobbings
Copy link
Contributor

I am having some difficulty reproducing the issue but I am happy to have another look later if you can provide more info on the exact sequence of steps you are taking.

@ash0080
Copy link
Contributor Author

ash0080 commented Jul 18, 2017

2017-07-18 4 17 19

After dragging
|
|
|

2017-07-18 4 17 27

After saving

@zhedar
Copy link

zhedar commented Jul 18, 2017

Can confirm this, sadly the fix proposed in #1575 doesn't have any effect. I also tried upgrading to core 1.3.0 alone, thus without updating the admin plugin. Still had the same problem though.

It seems like the pages are ordered by the date of creation. If I create a new page manually or through the admin plugin, it is still numbered correctly but not sorted after the other pages. This happens both in the admin view and the frontend.
bildschirmfoto 2017-07-18 um 14 51 25

Edit: Ok, editing the date of creation didn't really change anything. However, I still don't get why the pages I created last are always sorted last.

@flaviocopes
Copy link
Contributor

Uhm.. I tried replicating on 2 different setups (osx and linux) but I cannot recreate the issue.

@zhedar
Copy link

zhedar commented Jul 18, 2017

I'm on macOS as well, using the most recent version of MAMP (MAMP 4.11, Apache, PHP 7.11). Maybe it's also important, that I'm using a internationalized project as that seems to affect sorting as well.

@ash0080
Copy link
Contributor Author

ash0080 commented Jul 18, 2017

I made a clean reinstall using MAMP with all default configs, then the patch, seems not work at all,
I remember a moment before that seemed to be successful, but I can't reproducing the success now

@timrobbings
Copy link
Contributor

I've just had another look at this. I'm using Ubuntu, PHP 7.0.18 and Apache.

So far I've tried inserting unusual characters (accented, hieroglyphic, etc...) and tried removing leading zeros from folder names, but I'm still not having much success.

@ash0080 / @zhedar - what are the folder names (as displayed if you list the content of the directory)?

Could you paste the names so that I can copy them and have another go?

@matejkramny
Copy link

How does grav determine the order of the pages if not in alphabetical order?

@timrobbings
Copy link
Contributor

@zhedar:

If I create a new page manually or through the admin plugin, it is still numbered correctly but not sorted after the other pages. This happens both in the admin view and the frontend.

My understanding is that this is intentional behaviour - looking at the code, it appears manually ordered items are inserted before those with other ordering criteria. I think this is right but perhaps someone could confirm?

@zhedar
Copy link

zhedar commented Jul 18, 2017

@timrobbings
That's right. All my items have numeric sorting enabled and therefore are manually ordered. Therefore they get numeric prefixes, don't they? But as you can see in the screenshot above, this sorting doesn't apply correctly anymore. I'm currently using a backup version of 1.2.4 which still works as intended(?).

@timrobbings
Copy link
Contributor

timrobbings commented Jul 18, 2017

@zhedar - what do your folder paths look like?

I.e. what is the output if you cd into one of the incorrectly sorted folders and run 'pwd'.

@zhedar
Copy link

zhedar commented Jul 18, 2017

@timrobbings Here's a full overview of all my folder names and the first level's contents (I've got 2 levels of modular pages):

file  user/pages/home/*/*
user/pages/home/01._showcase/header2.jpg:        JPEG image data
user/pages/home/01._showcase/showcase.de.md:     ASCII text
user/pages/home/02._features/features.de.md:     UTF-8 Unicode text
user/pages/home/03._service/01._header:          directory
user/pages/home/03._service/02._subtext:         directory
user/pages/home/03._service/03._mitarbeiter:     directory
user/pages/home/03._service/04._mitarbeiter2:    directory
user/pages/home/03._service/05._service-text:    directory
user/pages/home/03._service/modular.de.md:       UTF-8 Unicode text
user/pages/home/04._teiledienst/01._header:      directory
user/pages/home/04._teiledienst/02._mitarbeiter: directory
user/pages/home/04._teiledienst/modular.de.md:   ASCII text
user/pages/home/05._verkauf/01._header:          directory
user/pages/home/05._verkauf/02._subtext:         directory
user/pages/home/05._verkauf/03._verkaufsgebiet:  directory
user/pages/home/05._verkauf/04._mitarbeiter:     directory
user/pages/home/05._verkauf/05._mitarbeiter2:    directory
user/pages/home/05._verkauf/modular.de.md:       ASCII text
user/pages/home/06._vermietung/01._header:       directory
user/pages/home/06._vermietung/02._subtext:      directory
user/pages/home/06._vermietung/03._mitarbeiter:  directory
user/pages/home/06._vermietung/employees.de.md:  ASCII text
user/pages/home/09._karriere/14276-049.jpg:      JPEG image data
user/pages/home/09._karriere/text.de.md:         exported SGML document text, UTF-8 Unicode text
user/pages/home/10._kontakt/_anschrift:          directory
user/pages/home/10._kontakt/_kontaktdaten:       directory
user/pages/home/10._kontakt/_oeffnungszeiten:    directory
user/pages/home/10._kontakt/flexcolumns.de.md:   UTF-8 Unicode text

It seems like any special characters – like ö – are converted to ascii counterparts like oe.

@zhedar
Copy link

zhedar commented Jul 18, 2017

Also just tried to deactivate all i18n features and remove some of the .de suffixes to make the site work in general without i18n, but that didn't change anything that far. Might have overlooked something important there though as it was only a quick test. Also didn't have the fix from #1575 active during that test run. May have another try soon.

@timrobbings
Copy link
Contributor

Thanks @zhedar.

FWIW, I am seeing problems with subfolders - which may be related although I'm not sure if it is the same as the one you describe. I'll summarise here.

Specifically, when you have the following structure:

01.home
  01.featured-work
02.portfolio
  01.item-1
  02.item-2
  03.item-3

If you configure the 01.featured-work template (a module of 01.home) to render a subset of 02.portfolio, then you should see that the collection is not correctly ordered.

Whereas, if you view the 02.portfolio template, you should see that the collection is correctly ordered.

Perhaps suggesting that sort order is not conveyed or applied correctly when pulling collections from sibling directory trees.

@zhedar
Copy link

zhedar commented Jul 18, 2017

Sorry, I feel a bit foolish right now. As I wrote I incorporated the fix from #1575, but I just looked into that file's history and saw that #1571 made another important change, which I didn't seem to have as I didn't add another git remote just for a single character change. Somehow this one wasn't referenced here yet, although I read about it in a comment at the blog post.

After adding these two changes sorting works as before 1.3 again. Will do some tests.

@timrobbings
Copy link
Contributor

timrobbings commented Jul 18, 2017

No problem, appreciate the help 👍

I think I've tracked down a potential issue relating to sorting as mentioned above, which probably isn't helping matters (although this appears to have been a problem < 1.3.0) - I will also try and do some more testing and may raise a separate ticket to avoid conflating multiple issues.

@ash0080
Copy link
Contributor Author

ash0080 commented Jul 19, 2017

OK, I got it finally, merge both #1571 & #1575, sorry for my mistake.

The left (maybe not a problem) is when you dragging, the numeric has one digit but not the format version

@flaviocopes
Copy link
Contributor

Can you confirm the latest develop has solved the problem for you? I still cannot replicate it.

@MattAppleton
Copy link
Contributor

MattAppleton commented Jul 19, 2017 via email

@flaviocopes
Copy link
Contributor

Fixed in 1.3.1 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants