| Anonymous | Login | Signup for a new account | 2013.05.21 22:05 CEST |
| Main | My View | View Issues | Change Log | Roadmap | Docs |
| Viewing Issue Advanced Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||
| 0001739 | [Piwigo] photos | minor | always | 2010.06.23 00:14 | 2010.06.30 00:03 | ||
| Reporter | madman | View Status | public | ||||
| Assigned To | nikrou | ||||||
| Priority | normal | Resolution | fixed | Platform | Postgresql | ||
| Status | closed | OS | CentOS 5.4 | ||||
| Projection | none | OS Version | Postgresql 8.4.2 | ||||
| ETA | none | Fixed in Version | 2.1.2 | Product Version | 2.1.1 | ||
| Target Version | Product Build | Trunk r6585 | |||||
| Summary | 0001739: [PostgreSQL] Recent pictures page returns database error | ||||||
| Description |
Because there are no images in the database, the recent pictures page fails. The query in admin/element_set.php on line 196 return a single row with no value, because there are no images in the database. I suggest the following rewrite: $query = 'SELECT MAX(date_available) AS date FROM '.IMAGES_TABLE; if ($row = pwg_db_fetch_assoc( pwg_query($query) ) ) { if (isset($row['date'])) { $query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE date_available BETWEEN '.pwg_db_get_recent_period_expression(1, $row['date']).' AND \''.$row['date'].'\''; $page['cat_elements_id'] = array_from_query($query, 'id'); } } |
||||||
| Steps To Reproduce | New installation -> Administration -> Photos -> Recent pictures | ||||||
| Additional Information |
Warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for type date: "" LINE 3: WHERE date_available BETWEEN (''::date - '1 DAY'::interval... ^ in /var/www/sites/fotos.aarjan.nl/piwigo/piwigo_svn/include/dblayer/functions_pgsql.inc.php on line 122 SELECT id FROM piwigo_images WHERE date_available BETWEEN (''::date - '1 DAY'::interval)::date AND '' ERROR: invalid input syntax for type date: "" LINE 3: WHERE date_available BETWEEN (''::date - '1 DAY'::interval... ^ |
||||||
| Tags | No tags attached. | ||||||
| browser | Mozilla | ||||||
| Database engine and version | Postgresql 8.4.2 | ||||||
| PHP version | 5.3.2 | ||||||
| Web server | Apache 2.2.3 | ||||||
| Attached Files | |||||||
|
|
|||||||
Notes |
|
|
(0004002) svn (reporter) 2010.06.24 20:48 |
[Subversion] r6599 by nikrou on trunk -----[Subversion commit log]---------------------------------------------------- Bug 1739 fixed : Recent pictures page returns database error If there's no image in database, don't select thems ! |
|
(0004003) svn (reporter) 2010.06.24 20:49 |
[Subversion] r6600 by nikrou on branch 2.1 -----[Subversion commit log]---------------------------------------------------- Bug 1739 fixed : Recent pictures page returns database error merge from trunk |
| Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group Contact |