|
phpMyEdit - Rozšírené detaily chyby |
[ Späť ]
|
|
|
ID:
|
Kategória:
|
Dôležitosť:
|
Reprodukovateľnosť:
|
Dátum vloženia:
|
Posledná zmena:
|
|
233 |
core / field option |
veľká |
vždy |
2004-04-19 14:18 |
2006-01-23 01:45 |
|
|
Autor:
|
jonw |
Platforma:
|
All |
|
|
Priradené:
|
nepto |
OS:
|
Debian Linux |
|
|
Priorita:
|
normálna |
Verzia:
|
3 |
|
|
Stav:
|
uzavretý |
Verzia produktu:
|
5.4 (stable) |
|
|
Build produktu:
|
|
Riešenie:
|
vyriešený |
|
|
Projection:
|
žiadny |
Duplicitné ID:
|
|
|
|
ETA:
|
žiadny |
|
|
|
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:
|
0000233-phpmyeditbug.zip.txt (1 KB) 1970-01-01 01:33 0000233-michal-patch.diff.txt (1 KB) 1970-01-01 01:33 |
|
Poznámky k chybe |
|
|
|
|
Forgot to say - the same appears to occur with current CVS version (as at 18th April '04) too. |
|
|
|
|
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 :) |
|
|
|
|
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. |
|
|
|
|
Confirmed - this has fixed the issue in my production code too, many thanks!
Maybe one to add to CVS ? |
|
|
|
|
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 ? |
|
|
|
|
Yup, that appears to be fine too, will need to test further but either way seems to fix the original problem.
Thanks again! |
|
|
|
|
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. |
|