DBFM does not appear to install correctly
| Project: | DataBase File Manager |
| Version: | 5.x-4.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Hola,
I have tried version 4.0 and 3.5 of this module and both are giving me the same symptoms when trying to install:
1. Error in watchdog -
Field 'fblobmod' doesn't have a default value query: INSERT INTO dbfm_file (fid, uid, fpath, fname, fsize, fmime, fcreatedate, flastmod, fparent, fwaccess) VALUES (1, 1, '/dbfm', 'dbfm', 0, 'directory', '2008-09-03 13:03:20', '2008-09-03 13:03:20', 0, 2) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\includes\database.mysqli.inc on line 154.2. Error "Cannot access either your current directory or the top level directory - Please report the circumstances of this error" as a popup when I click the "Database File Manager" link in the navigation bar.
3. Clicking the "Click here to add file" icon when creating content just causes the browser to return to the top of the page and an "error on page" icon appears (The error is 'object expeted on line 3119).
System info
Drupal version 5.10
PHP 5.x
MySQL 5.x
Apache 2.2
Windows server 2003.
Any feedback would be very welcome, as this module appears to be exactly what I need.
Kind regards,
Danielle

#1
I've done some digging, and the error appears to be due to my DB server running in strict mode (something I'm reluctant to change on my production site). Is there likely to be a future release which does not cause this error?
Cheers,
Danielle
#2
Updarte
After disabling strict mode, and generally doing some messing around I've been able to get the module to appear to start to work. The popups and buttons now function etc.
However, there is now a new problem. Each time I try to upload a file there is an error displayed in the popup:
WARNING: Unable to upload your data file into the dBand the following errors are added to watchdog:
mysql_real_escape_string() expects parameter 2 to be resource, object given in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\dbfm\dbfm.module on line 1735.mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\dbfm\dbfm.module on line 1843.Would really appreciate some help with resolving these issues.
Cheers,
Dani
#3
Danielle,
Sorry I've taken so long to get back - I've been on my hols.
I'll work through the issues in turn. There's a problem with the install file. The root record isn't correctly initialised. The correct install file is attached.
Geoff
The uploader is fussy about file extensions so please rename the attached txt file as dbfm.install
#4
As you know when you tell mySQL to run in strict mode it stictly enforces any data validation.
The problem was that the install script was trying to create a new entry for the 'root' directory in the dbfm_file table. The fblobmod field was specified to be NOT NULL yet no value was given for the field ... UGHHH!
That should now have been fixed so you should now be able to create your new 'filesystem' in the database. If there are still problems please let me know.
#5
Hi Geoff,
Hope you had a nice holiday :)
Your new installer seems to have solved the problems with installing into strict-mode enabled servers, the second issue still remains though:
[snip]
Each time I try to upload a file there is an error displayed in the popup:
WARNING: Unable to upload your data file into the dBand the following errors are added to watchdog:
mysql_real_escape_string() expects parameter 2 to be resource, object given in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\dbfm\dbfm.module on line 1735.mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\dbfm\dbfm.module on line 1843.[/snip]
I've googled the error, but there seems to be a legion of possibilities which could be the cause, any ideas?
As an aside, I have the following observations (no show stoppers):
1. Disabling the module then selecting 'unistall' does not remove the following tables from the database and had to be dropped by hand:
dbfm_cronlistdbfm_data
dbfm_file
dbfm_perm
2. In the administration menu, the option for dbfmgreybox is all in lower case; no biggie but looks untidy :)
3. The DBFM install instructions are a little vague, it would have saved some time if they mentioned you have to save the config options and the dbfmgreybox settings before attempting to use the main module.
This module looks quite superb, I am really looking forward to getting it up and running in production.
Thanks again for the support,
Dani
#6
Danielle,
Ughh and more ughh!! The error that's being thrown up is basically because mysql doesn't recognise the contents of the global variable $active_db.
As regards the uninstall errors - all the tables are in the uninstall script so we must look elsewhere for why they are not being deleted.
Questions
Are you using replication or is this a stand-alone implementation?
Can you look in your settings file (in sites/default) at the $db_url entry and tell me what's there?
Can you slip a bit of code into the dbfm.module file (a line above each of your errors) to record what the $active_db variable is set to?
something like:
watchdog('DaniErr', 'active db is ' . $active_db);
Ta muchly
#7
Hi Geoff,
This is fun :)
I'll play around some more with the uninstaller to try and replicate the observation and see if there are any logged errors.
On production the servers are replicated but on the testing environment it's stand-alone, I've only used the module on the test environment so far. If it will help I can recofigure the server and add replication to a VM.
My $db_url is:
$db_url = 'mysqli://dblogin:dbpassword@localhost/dbname';*note* the actual password has ascii symobols and text
I've added the error code to the module as requested. The code itself works, but does not append the output with the value of $active_db, my spidey sense tells me the new error which is now in the log might just be related to this hehe :
Object of class mysqli could not be converted to string in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\modules\dbfm\dbfm.module on line 1844.Cheers,
Dani
P.S. I'm happy to take this to MSN and post the final results at the end if it would help.
#8
Quick update: I tried changing the connection to mysql instead of mysqli and it appears to be working, I'll do some testing.
*edit* Changing the connection to mysql confirmed as a fix, the module seems to do everything it's supposed to using the older connection type.
I'm very impressed with the level of support given here, many thanks. Is there anything you would like me to do to in order to get mysqli working, or is mysql only a limitation at the moment?
Cheers,
Dani
#9
If you think including mysqli support is worthwhile then I'd be very pleased to integrate any changes to support it into the dbfm code ... if you were to write them!!
Last time I looked at mysqli was 3 years ago and, apart from pre-escaping the statements it didn't seem to offer any clear advantage that was useful to me. In fact I haven't really heard that much about it during the last few years. Is it worth using?? I know it's supposed to be more secure.
Thanks for finding the bug for me!
Geoff
#10