Strange things with MDB2
Hi.
I've install Drupal and SOPAC2.
I've also import the records set that you give ti test everything.
SOPAC2 looks running but, when I'm clicking on "My Liibrary", I'm getting : "Fatal error: Call to undefined method MDB2_Error::query() in /usr/local/lib/insurge/insurge-client.php on line 291"
Help would be welcome.
Thanks.
DB

Well in fact I forgot to made an pear install pear/MDB2#mysql..
So the fatal error now disappear (I've got some other one... Let's take a look at that one ;-) )
I was getting the following error
Fatal error: Call to undefined method MDB2_Error::fetchOne() in /usr/local/lib/insurge/insurge-client.php on line 292
I edited the insurge-client.php and added on 293 the following code
/* TSCR adding code to capture error */
if (PEAR::isError($dbq)) {
die("Failed to issue query, error message:" . $dbq->getMessage(). $where_str);
}
* TSCR */
Line 287 was altered
if (count($bnum_arr)) { $where_str .= ' ' . $where_prefix . ' bnum IN (\'' . implode(', ', $bnum_arr) . '\') '; $where_prefix = 'AND'; }
as this was showing a syntax error in the $bnum_arr. I think we just needed $bnum_arr('')
The next error was
Fatal error: Call to undefined method MDB2_Error::fetchAll() in /usr/local/lib/insurge/insurge-client.php on line 66
I took the same approach to solving this by adding the code
/* TSCR adding code to capture error */
if(PEAR::isError($result)) {
die("Failed to issue query, error message:" . $result->getMessage() . $sql);
}
/* TSCR */
The $sql command is
SELECT tag, count(tag) AS count FROM insurge_tags WHERE group_id = "YOUR GROUP ID" AND bnum IN () GROUP BY tag ORDER BY count DESC LIMIT 500
When issuing this from the command line mysql>
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') GROUP BY tag ORDER BY count DESC LIMIT 500' at line 1
Line 61
if (count($bnum_arr)) { $where_str .= ' ' . $where_prefix . ' bnum IN (' . implode(', ', $bnum_arr) . ') '; $where_prefix = 'AND'; }
Now
if (count($bnum_arr)) { $where_str .= ' ' . $where_prefix . ' bnum IN (\'' . implode(', ', $bnum_arr) . '\') '; $where_prefix = 'AND'; }
This solved the problem for me.
I have this on a subversion server
svn://drupal.acpl.lib.in.us/sirsisopac