I have bumped into something interesting when trying to search for the records owned by a specific user (using the filed Location or Call number). The Advanced search produces this SQL query:
SELECT author, title, year, publication, volume, pages, location, thesis, orig_record, serial, file, url, doi, isbn, type FROM refs LEFT JOIN user_data ON serial = record_id AND user_id = WHERE serial RLIKE ".+" AND location RLIKE "email@example.com" ORDER BY author, year DESC, publication
and I get an error message during the execution:
Error 1064 : Erreur de syntaxe près de 'WHERE serial RLIKE ".+" AND location RLIKE "antoine@deuxieme-lab' à la ligne 1
I assume it is because the "user_id =" parameter is left empty by the Advanced search form. Anyone has an idea why? And how to fix this?
Thank you in advance!
it's correct that the missing user_id value in the SQL query causes your error. Are you only experiencing this problem when searching via Advanced Search? I.e., do all other refbase functions seem to work as expected?
I cannot reproduce this problem. Can you verify whether you see the same problem at:
Also, are cookies allowed in your web browser for your refbase server? And does the PHP installation of your refbase server have its session support enabled?
I am all the more surprised as I have two Refbase installations on the same server (separate SQL databases) and one has the problem, not the other. Hence I assume that the cookies settings and PHP settings (all identical) have nothing to do with it.
The defect installation also seems not to recognize the users anymore (login ID and passwords rejected), although they are still in the users table...
I guess these problems are related but I do not know exactly how. And I thought the Advanced search error is a good place to start.
> I am all the more surprised as I have two Refbase installations on the same
> server (separate SQL databases) and one has the problem, not the other.
Can you attempt to enumerate all differences between the two installations? Take a recursive diff of the two directories; look up exactly how apache is configured to use the two directories (particularly if they are separate vhosts), and look at the information on all tables in MySQL.
Thank you, here are the results of my investigation:
- the differences in the files structure are where you would expect them to be (I copy below the output of the diff command):
diff -u -r -B -N -s /Users/antoine/Sites/biblio/initialize/db.inc.php /Users/antoine/Sites/pnrpe/initialize/db.inc.php
--- /Users/antoine/Sites/biblio/initialize/db.inc.php 2009-08-26 12:03:38.000000000 +0100
+++ /Users/antoine/Sites/pnrpe/initialize/db.inc.php 2009-08-26 12:10:58.000000000 +0100
@@ -38,7 +38,7 @@
// refbase package:
// Note: - if there's no existing database with the specified name,
// the 'install.php' script will create it for you
- $databaseName = "enro_refbase"; // e.g.: "literature"
+ $databaseName = "enro_pnrpe"; // e.g.: "literature"
// The name of the MySQL user that's going to be used with your MySQL
// literature database:
diff -u -r -B -N -s /Users/antoine/Sites/biblio/initialize/ini.inc.php /Users/antoine/Sites/pnrpe/initialize/ini.inc.php
--- /Users/antoine/Sites/biblio/initialize/ini.inc.php 2009-04-05 18:47:00.000000000 +0100
+++ /Users/antoine/Sites/pnrpe/initialize/ini.inc.php 2009-08-26 12:10:59.000000000 +0100
@@ -23,7 +23,7 @@
// The official name of this literature database:
- $officialDatabaseName = "Bibliographie FADO"; // e.g. "IP÷ Literature Database"
+ $officialDatabaseName = "Bibliographie PNRPE"; // e.g. "IP÷ Literature Database"
// Specify who'll be allowed to add a new user to the users table:
@@ -448,7 +448,7 @@
// directory (named "files") is located on the root level of your refbase script directory (named
// "refs") the path spec could be something like: "/usr/local/httpd/htdocs/refs/files/"
// (IMPORTANT: if given, the base dir MUST end with a slash!)
- $filesBaseDir = "/home/www/enro/www/deuxieme-labo/biblio/fichiers/"; // e.g. "/usr/local/httpd/htdocs/refs/files/"
+ $filesBaseDir = "/home/www/enro/www/deuxieme-labo/pnrpe/fichiers/"; // e.g. "/usr/local/httpd/htdocs/refs/files/"
// The URL to the default file directory that you've specified in $filesBaseDir:
- the Apache configuration is strictly the same as both installs are on the same (shared) web server
- I could not find any difference in the tables definitions on MySQL (here again, the MySQL server is the same, only the databases differ).
Also, one observation that could help solve the problem: when I log in the installation of Refbase #1, I just need to change the URL to the installation #2 (i.e. replace one folder name by the other) and I am also logged in this other installation, even though I was not previously logged in. Obviously, my user name and password are the same for both, but still… :-/
> The defect installation also seems not to recognize the users anymore (login ID and passwords rejected), although they are still in the users table...
Going back to this: do the two user tables look identical? What, exactly, happens when you try to login to the broken server? What happens when you create a new user account and/or re-generate the password? Are you able to then login?
-both tables "users" look identical (I actually dumped the one that worked to create the one that doesn't)
- when trying to login I get the following message: "Login failed! You provided an incorrect email address or password."
- creating a new user account works OK, re-generating the password does not…
I am really confused, and I don't know whether all my troubles have one or several origins!
I think I've experienced something similar. I.e. with multiple refbase installations being installed on the same server, an active login in one refbase database might confuse the login status (and display properties) in another refbase database on the same server. In my case, the locale support was broken (i.e. localized strings weren't displayed at all).
In my experience, everything starts to work fine again as soon as I logout from the first refbase database and properly login again in the second one.
Does your problem persist if you first logout from any refbase databases installed on your server, then log into the "problematic" refbase database?
Thanks for the suggestions but this does not work either… :-(
Log in to post a comment.