Jump to content

Issue with manual (or default) sorting in the Admin


landitus
 Share

Recommended Posts

Hello! I'm having a strange issue in only one of my PW sites with the manual sorting of pages. I can't sort pages manually in the admin anymore! I have a group of pages in the site that have manual sorting in their parent's settings and PW let's me drag drop pages around. Everything stays in place the way I want, and no errors arise, but when I reload the page the sort change are not saved and everything stays in the same same.

Maybe I'm missing something here cause I'm stuck!! I had some issues with this server provider (in my last two forum messages) so I am betting this can be the cause. I'm using PW 2.2.0 (should I try an upgrade?) Any clues?

post-72-0-03357400-1334847938_thumb.png

Link to comment
Share on other sites

Just to confirm, the sort settings in your screenshot are for the parent page of those you are trying to sort?

If you can, turn on your developer tools (Firebug in FF or Dev Inspector in Chrome). Watch what it does when you finish the sort. Do you see any JS errors? If you click on the network request, do you see any messages in the response that look like errors?

Link to comment
Share on other sites

Ryan, thanks for answering. The parent is called "Banners" and has manual sort (that's the screenshot). It has 12 "banner" children/pages which I'm trying to sort. Turning Developer tools shows everything is fine: the console it silent and the network request POST is perfomed and shows:

  • error: false
  • message: "Updated sort for 12 pages"
Link to comment
Share on other sites

I've been testing this and found yet another odd thing... The desired order is showed on the front-end though it's not updated in the admin page tree. I guess it's just a problem in my admin panel.

Link to comment
Share on other sites

Landitus, try adding this to one of your templates somewhere, view a page using it, and see what it says. Replace '/path/to/parent/' with the path to the parent page of the children that aren't getting the correct sort in the admin.

$children = $pages->get('/path/to/parent/')->children();
echo "<ul>"; 
foreach($children as $child) echo "<li>{$child->sort}: {$child->url}</li>"; 
echo "</ul>";

What you should see is a list of a child pages with the number on the left starting at 0 and incrementing by one for each. But let me know if you see something different.

Another thing to try would be to change your parent to have some specific sort, save it, then change it back to no sort. I can't say as though I've ever had to do that before, but it seems like one way to just reset things there, just in case.

Link to comment
Share on other sites

Ryan, my results where diferent. Actually the numbers are my desired order, and the order showed here is exactly what's shown in the admin. I've tried re-setting the sorting orden with no luck!

  • 3: /pw/promos/promo.../
  • 4: /pw/promos/promo.../
  • 5: /pw/promos/promo.../
  • 6: /pw/promos/promo.../
  • 7: /pw/promos/promo.../
  • 8: /pw/promos/promo.../
  • 9: /pw/promos/promo.../
  • 10: /pw/promos/promo.../
  • 11: /pw/promos/promo.../
  • 0: /pw/promos/renova.../
Link to comment
Share on other sites

Do try a table repair... :) (could be)

Adit:

- or try opening a childpage and change something and save it.

- or sort the last page to first place

Also try trace 1 page (id) in the db table where the sort field is. Before and after you sort change one page in the admin, what happens in the db table? Does it change anything?

  • Like 1
Link to comment
Share on other sites

I agree with Soma on all points. The first thing I would try is his suggestion to drag/sort the last page to the first spot. That would force it to re-populate the 'sort' field from all the pages in the list. But if that doesn't do it, I think a table repair would be the next step. Any time MySQL is producing some unexplainable behavior, a repair is a good way to go. But luckily that's not often. :)

Link to comment
Share on other sites

Well, thanks for the suggestions. I couldn't fix the problem, yet.

Do try a table repair... :) (could be)

I've repaired two tables (pages and images) that had overhead. The repair was successful, but no change. I followed this tutorial

- or try opening a childpage and change something and save it.

- or sort the last page to first place

No change either.

Also try trace 1 page (id) in the db table where the sort field is. Before and after you sort change one page in the admin, what happens in the db table? Does it change anything?

This was interesting. The table is getting the right values. I've traced a page via phpmyadmin and It gets the position I'm giving it. Also, the other pages change their positions as well. I went to the admin, but there, the order is still the same stuck order. Looking closer, I think it's stuck in a "created at" order. And that order is also showing in the front-end.

I'm stuck :( I'm trying to trace the problem, but sorting did use to work for a while. It's weird, cause in have 2 other sites with this same host provider. The only mayor difference is that this DB is shared with some tables from Codeigniter, which are prefixed CI. This PW installation is inside a pw folder. And that's it. So I'm out of leads with this.

Link to comment
Share on other sites

If you want, email or PM me a copy of your database (SQL dump) and I can try to load it here to see what the issue might be.

Also, I think it would be worthwhile to grab the latest source code (2.2.0.1) to replace your /wire/ dir with the latest, just in case.

Link to comment
Share on other sites

Just got a chance to test this here. Unfortunately I can't seem to reproduce it though. I tried drag-sorting child pages in both /tester/ and /promos/, but the order is retained regardless of what I try. I'm starting to wonder if we're looking in the wrong place. What web browser and version are you using?

Link to comment
Share on other sites

Ryan, thanks for testing. I use both Firefox and Chrome latest versions, and both show the same. I didn't understand what you mean with "the order is retained regardless of what I try". The order should change, right? I want to clarify that both the backend and front end show the pages/records in the wrong order (I presume is created-at) in my installation, but the DB shows the right number, which is the manual order. Where you able to re-sort everything correctly?

Link to comment
Share on other sites

What I mean by "the order is retained" is that it was consistent with how I ordered it. I was able to re-sort everything without any unexpected results. I tried about a dozen times just to be sure. Since I can't reproduce it here, is it something I could login to there?

Link to comment
Share on other sites

I've been trying lots of different things, I think I found something interesting. I tried installing a brand new PW in a subfolder and in a diferent database on the same server my site is in. I did the install on the server (not in my local machine) and found some warnings (see attached screenshot). Then, having a brand new PW installation, I tried to sort the About pages, and to my surprise, the same happens. The sort looks fine, reload and bam, same problem, the sort is not reflected in the admin.

So, this could be a server issue? Are those errors any indication?

PD: Ryan, I can definitely give you access. Do you need a PW user? FTP access?

post-72-0-02281300-1335403354_thumb.png

Link to comment
Share on other sites

Glad the answer turned up! I was really confused about this one. :) I'm surprised that any web hosts would be using a MySQL version with this issue. It seems like this would affect almost anything that uses MySQL.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...