Projects ⇒ Bugs ⇒ #1006: keyword search issue ⇒ CPG Dragonfly™ CMS
Bug #1006 keyword search issue
Project: Dragonfly 9.0.3 -> 9.3 Category: Coppermine
Submitted: Tuesday, January 01, 2008 (04:36:00) Modified: Saturday, February 02, 2008 (22:33:49)
Status: Closed Assigned to: NanoCaiordo
PHP Version: 5.2 HTTPD Server: Apache 1.3
Votes: 4
Vote results:
Avg. Score: 3.2 ± 0.4 Reproduced: 2 of 4 (50.0%)
Same PHP Version: 0 (0.0%) Same HTTPD Server: 1 (50.0%)

View/Vote Add Comment

by: dusman
Description:
------------
If you add keywords to a picture and then click on once of those keywords which brings up other images with the same keyword, you are then NOT able to click on any of those pictures returned. It return the error below

Reproduce code:
---------------
add keyword "test" to at least 2 images, click on the test keyword on 1 of the images which will then show the other images that have the same keyword, now try to click on one of those other images, error is given

Expected result:
----------------
no error, show picture as selected

Actual result:
--------------
error

On /coppermine/displayimage/meta=search/cat=0/pos=9.html
While executing query "SELECT visibility FROM cmsdf_cpg_albums WHERE aid=search LIMIT 1"

the following error occured: Unknown column 'search' in 'where clause'
by: NanoCaiordo
Dragonfly version used?
by: greenday2k
I have not found this "bug" on my tests installs and nor in my site.

i've tested this on
Linux/1.3.37 (Unix)/4.1.21-standard/4.4.4/Dragonfly 9.1.2.1
Linux/1.3.37 (Unix)/5.x-standard/5.x/Dragonfly 9.2 CVS

and cant reproduce the error.

Tested "live" on:
http://greenday2k.net/coppermine/thumbnails/meta=search/search=green.html
by: dusman
my stats are up to date

Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1

I have duplicated the issue on 2 seperate 9.2RC sites
by: whatrevolution
I can reproduce this bug on a clean, barely configured DF 9.2.0RC2

Following the "Reproduce code:" instructions, the result URL was: /index.php?name=coppermine&file=displayimage&meta=search&cat=0&pos=0

I used 3 images, in the same category, with 2 keywords each; one unique keyword, one shared.

The shared keyword accessed via link on /coppermine/displayimage/album will generate a page of URLS like above.

Debug report was posted: http://dragonflycms.org/Forums/viewtopic/p=138556.html#138556
by: NanoCaiordo
From the debug that you posted in our Forums i can see that you are using the keyword "white" for your search.

Is this the shared keyword, the unique or its not used by your images at all?
by: NanoCaiordo
Whats the results if you manually run the following query
SELECT COUNT(*) FROM cms_cpg_pictures AS p INNER JOIN cms_cpg_albums AS a ON (p.aid = a.aid AND visibility > -1) WHERE ( pid in (1,2,3) ) AND approved=1 GROUP BY pid
by: NanoCaiordo
Please try using one of these CVS snapshots:

Latest tar.gz
Latest tar.bz2
by: whatrevolution
"white" was the common keyword.

"Result of query: http://dragonflycms.org/Projects/bugs/id=1006/edit=3.html#c2209" wrote

Showing rows 0 - 2 (3 total, Query took 0.0001 sec)
SQL query:
SELECT COUNT( * )
FROM cms_cpg_pictures AS p
INNER JOIN cms_cpg_albums AS a ON ( p.aid = a.aid
AND visibility > -1 )
WHERE (
pid
IN ( 1, 2, 3 )
)
AND approved =1
GROUP BY pid
LIMIT 0 , 30


Moving on to the snapshots, brb.
by: whatrevolution
"/dfsandbox/html-200801271200/index.php?name=coppermine&file=thumbnails&meta=search&search=white" wrote

Fatal error: Call to undefined function: ufetchrowset() in /home/[user]/[path]/dfsandbox/html-200801271200/includes/coppermine/search.inc on line 172
by: NanoCaiordo
Index: includes/coppermine/search.inc =================================================================== RCS file: /cvs/html/includes/coppermine/search.inc,v retrieving revision 9.6 diff -u -r9.6 search.inc --- includes/coppermine/search.inc 27 Jan 2008 07:52:51 -0000 9.6 +++ includes/coppermine/search.inc 27 Jan 2008 14:05:30 -0000 @@ -169,7 +169,7 @@ $nbEnr = $db->sql_fetchrowset($result); $pic_count = $nbEnr[0]; */ - $pic_count = $db->ufetchrowset("SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON (p.aid = a.aid AND ".VIS_GROUPS.") WHERE ($pic_set) AND approved=1 GROUP BY pid",SQL_NUM); + $pic_count = $db->sql_ufetchrow("SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON (p.aid = a.aid AND ".VIS_GROUPS.") WHERE ($pic_set) AND approved=1 GROUP BY pid",SQL_NUM); $pic_count = $pic_count[0]; if ($select_columns != '*') $select_columns .= ', p.title, caption'; $rowset = $db->sql_ufetchrowset("SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS a ON (p.aid = a.aid AND ".VIS_GROUPS.") WHERE ($pic_set) AND approved=1 GROUP BY pid $limit",SQL_BOTH);
by: whatrevolution
The snapshot's DB:

http://dragonflycms.org/Projects/bugs/id=1006/edit=3.html#c2209 wrote

Showing rows 0 - 2 (3 total, Query took 0.0004 sec)
SQL query:
SELECT COUNT( * )
FROM dev_cpg_pictures AS p
INNER JOIN dev_cpg_albums AS a ON ( p.aid = a.aid
AND visibility > -1 )
WHERE (
pid
IN ( 1, 2, 3 )
)
AND approved =1
GROUP BY pid
LIMIT 0 , 30
by: whatrevolution
modules/coppermine/displayimage.php

* Notice line 147: Undefined index: keywords
* Notice line 236: Undefined index: owner_id
* Notice line 241: Undefined index: pic_raw_ip
* Notice line 264: Undefined index: owner_id
* Notice line 277: Undefined index: votes
* Notice line 280: Undefined index: keywords
by: whatrevolution
Previous comment was:
functions.inc revision 9.45
search.inc revision 9.7

So is this:
/index.php? name=coppermine&file=displayimage&meta=lastalb&cat=0&pos=1

GET

array (
'name' => 'coppermine',
'file' => 'displayimage',
'meta' => 'lastalb',
'cat' => '0',
'pos' => '1',
)

POST

array (
)

SQL Queries:

includes/coppermine/functions.inc

* 0.0001 - LINE 42: SELECT COUNT(*) FROM dev_cpg_pictures WHERE approved=0
* 0.0001 - LINE 641: SELECT COUNT(*) from dev_cpg_pictures AS p INNER JOIN dev_cpg_albums AS a ON (p.aid = a.aid AND visibility > -1 AND category >= '0') WHERE approved=1 AND category >= '0'
* 0.0011 - LINE 644: SELECT p.pid, p.filepath, p.filename, p.filesize, p.ctime, p.title, p.pwidth, p.pheight, p.caption, p.aid, a.title AS title, a.aid AS aid FROM dev_cpg_pictures AS p INNER JOIN dev_cpg_albums AS a ON (p.aid = a.aid AND visibility > -1 AND category >= '0') WHERE approved = 1 GROUP BY a.aid ORDER BY p.ctime DESC LIMIT 1,1
* 0.0001 - LINE 98: SELECT count(*) FROM dev_cpg_albums
* 0.0001 - LINE 98: SELECT count(*) FROM dev_cpg_pictures
* 0.0001 - LINE 98: SELECT sum(hits) FROM dev_cpg_pictures
* 0.0001 - LINE 98: SELECT sum(votes) FROM dev_cpg_pictures
* 0.0001 - LINE 98: SELECT count(*) FROM dev_cpg_comments
* 0.0001 - LINE 641: SELECT COUNT(*) from dev_cpg_pictures AS p INNER JOIN dev_cpg_albums AS a ON (p.aid = a.aid AND visibility > -1 AND category >= '0') WHERE approved=1 AND category >= '0'
* 0.0001 - LINE 644: SELECT p.pid, p.filepath, p.filename, p.filesize, p.ctime, p.title, p.pwidth, p.pheight, p.caption, p.aid, a.title AS title, a.aid AS aid FROM dev_cpg_pictures AS p INNER JOIN dev_cpg_albums AS a ON (p.aid = a.aid AND visibility > -1 AND category >= '0') WHERE approved = 1 GROUP BY a.aid ORDER BY p.ctime DESC LIMIT 0,10

modules/coppermine/displayimage.php

* 0.0001 - LINE 556: SELECT title, comments, votes, category FROM dev_cpg_albums WHERE aid='2' LIMIT 1
* 0.0001 - LINE 265: SELECT username FROM dev_users WHERE user_id=''
* 0.0001 - LINE 359: SELECT msg_id, msg_author, msg_body, msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip FROM dev_cpg_comments WHERE pid='2' ORDER BY msg_id ASC
by: whatrevolution
I should have pointed out that the new error is causing the keyword links to not appear on displayimage.
by: NanoCaiordo
This bug has been fixed in the CVS.

Snapshots of the sources are packaged every 6 hours; this change
will be in the next snapshot. You can grab the snapshot at the
Downloads section.

Thank you for the report, and for helping us to make Dragonfly 9.0.3 -> 9.1 better.
User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español