Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 11. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Zoznam chýb  »  Chyba #233

Rozšírené detaily chyby [ Preskočiť na poznámky k chybám ] [ História chýb ] [ Vytlačiť ]
ID Kategória Dôležitosť Reprodukovateľnosť Dátum vloženia Posledná zmena
0000233 core / field option veľká vždy 2004-04-19 14:18 2006-01-23 01:45
 
Autor jonw Zobraziť status verejný  
Priradené nepto
Priorita normálna Riešenie vyriešený Platforma All
Stav uzavretý Duplicitné ID OS Debian Linux
Projection žiadny Verzia 3
ETA žiadny Verzia produktu 5.4 (stable)
  Build produktu
  Hlasy 1
 
Zhrnutie Sort order for phpMyEdit forms reversed after 'more' button used
Popis Easiest explained with a test case (see file attachment).

Basically, using $opts['sort_field'] = array('-timestampfield') works fine when the phpMyEdit form is initially displayed, but when a record is added and the 'More' button clicked to add an additional record, then 'Cancel' clicked the original sort order for the form has been lost and the form contents are listed as if $opts['sort_field'] = array('timestampfield'); had been used instead (ascending date/time order instead of descending).
Kroky k vyvolaniu 1. Use test.sql database from included file to create a new database 'testdb', adjust username/pass in testnews.php to suit database server.

2. Open testnews.php in a browser - notice that date order is correctly reverse-sorted (newest items first).

3. Click on 'Add', then fill in a date and some contents for the new news item.

4. Click 'More', then click 'Cancel'.

You are returned to the list, but the sort order has now been reversed and the newest item is now at the bottom of the list.
Dalšie informácie
Pripojené súbory phpmyeditbug.zip (1,222 bytes) 2004-04-19 14:18
michal-patch.diff (973 bytes) 2004-07-13 19:29

Poznámky k chybe
jonw
2004-04-19 14:24

Forgot to say - the same appears to occur with current CVS version (as at 18th April '04) too.
 
michal
2004-04-19 18:42

after some test, try to move line
$this->sfn[] = '0'; // this last entry will be replaced in recreate_displayed()

to recreate_displayed(), before line
$this->sfn[count($this->sfn) - 1] = "$k"; // important quotes

for me it helped.

but changing to 'date' to array('date') helped too (in my first tests), so i'm not sure :)
 
jonw
2004-04-20 01:45

OK, patched the code as suggested and it fixes the case in my test database, will now retest against main code and see if it works there too.

Many thanks for the prompt responses and help Michal.

Will confirm here if it fixes the original code too.
 
jonw
2004-04-20 06:58

Confirmed - this has fixed the issue in my production code too, many thanks!

Maybe one to add to CVS ?
 
michal
2004-04-20 09:11

and to add some code efficiency, can you confirm changing
$this->sfn[] = '0';
$this->sfn[count($this->sfn) - 1] = "$k"; // important quotes

to
$this->sfn[] = "$k";

works ?
 
jonw
2004-04-20 09:55

Yup, that appears to be fine too, will need to test further but either way seems to fix the original problem.

Thanks again!
 
nepto
2004-07-13 19:34

Uploaded michal's patch, which seems to work OK.

Bug was fixed in CVS. It also fixes strange sorting dissapear after Apply button usage.

Thank you for your contribution and michal for the bugfixing idea. Feel free to reopen if problem still persists.
 

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov