jonw
Joined: 19 Apr 2004
Posts: 5
Posted: 2004-04-19 06:01
Back to top
Reply with quote
|
Hi, I've recently been looking at upgrading a site I run which uses phpMyEdit to maintain a lot of the system SQL tables and have noticed something odd since moving from 5.3 to 5.4. (The same problem appears to occur in the current (18th April) CVS too)
I'd like to move to 5.4 so I can start using the popup calendar functionality, but this happens even without that enabled:
I have a table which stores news items, I use:
$opts['sort_field'] = '-date';
To ensure that the most recent items are listed first in phpMyEdit. I don't display any sort controls or give users the ability to change the sort / filters.
When the screen first loads, the order is correct, when I add a new item and click 'Save' the order is correct, and if I click 'Cancel' the order is correct.
As soon as I use the 'More' (or 'Apply') button though, the order gets reversed when I return to the list view as if I'd used:
$opts['sort_field'] = 'date' (without the '-').
This gets weird when limiting the number of records per page as when the date order gets inverted the page numbers get very confused.
Should this be reported as a bug or am I missing something obvious ?
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2004-04-19 08:05
Back to top
Reply with quote
|
is your problem similar to
http://opensource.platon.sk/forum/projects/viewtopic.php?t=343&highlight=date ?
|
jonw
Joined: 19 Apr 2004
Posts: 5
Posted: 2004-04-19 09:20
Back to top
Reply with quote
|
Nope, the sort works fine when you first go to the page, but after you use 'apply' or 'more' when changing or adding a record and go back to the list the order is then inverted.
Reloading the page from scratch gets everything back into order (until you use apply or more again).
I've also made sure that the lang files are the ones from the 5.4 release and not older ones left hanging around.
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2004-04-19 09:44
Back to top
Reply with quote
|
yet another suggestion, try current CVS version of the core class (on your left CVS/browser/phpMyEdit/..)
there have several changes since 5.4 release.
the problem is probably with the second part of recreate_displayed(). i've tried to understand this part, but i was unsuccesful....
|
jonw
Joined: 19 Apr 2004
Posts: 5
Posted: 2004-04-19 10:18
Back to top
Reply with quote
|
Already tried the CVS version (see 1st post above), it has exactly the same problem.
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2004-04-19 10:45
Back to top
Reply with quote
|
i'm sorry, note to use CVS version solves third of the problems. so it's the first answer i try :)
after some testing
| Code: |
$opts['sort_field'] = array('-date');
|
works
while
| Code: |
$opts['sort_field'] = '-date';
|
does not work.
there are just two questions left:
why one works and second one does not ?
does anybody care ? :)
|
jonw
Joined: 19 Apr 2004
Posts: 5
Posted: 2004-04-19 13:10
Back to top
Reply with quote
|
Well, I care - pretty much means I can't use 5.4 (I have some *really* dumb users) :(
Have tried using array('-date') and get the same (wrong) result after clicking 'more' then 'cancel' the list still gets reversed :(
I've produced a simple case which shows the problem, will post as a bug.
|
jonw
Joined: 19 Apr 2004
Posts: 5
Posted: 2004-04-19 13:22
Back to top
Reply with quote
|
Have posted as a bug #233
here
.
Includes my test code to reproduce the problem using 5.4 (stable) here.
|
|
Post new topic
Reply to topic
|