Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /home/john/Documents/Work/website/sites/all/modules/document/document.module on line 409 and defined in db_query() (line 2282 of /home/john/Documents/Work/website/includes/database/database.inc).

CommentFileSizeAuthor
#2 document-db-api.patch3.4 KBxcheng
#1 document-db-api.patch3.53 KBxcheng
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xcheng’s picture

FileSize
3.53 KB

I rewrote db_*, file_* APIs in document.module such that it runs correctly in D7.

The patch also includes the fix from #1194418: Warning: Parameter 1 to document_search_form() expected to be a reference, value given in drupal_retrieve_form() post 11

xcheng’s picture

FileSize
3.4 KB

Sorry for the previous patch, it didn't fix file deletion correctly. This one uses file_delete() instead of file_unmanaged_delete() and manual db_delete().

So far this module looks pretty stable to me.

efc84’s picture

Hi,

I'm new to Drupal and need this module to function as it is essential to the website. Can you tell me the exact path in the FTP where to find the below files?

db_*, file_* APIs

Thanks

jacobson’s picture

If you look inside the patch file, you will see the name of the file to which the patch applies -- document.admin.inc -- and you use the patch command (on linux anyway) to apply the patch. The file will be located in the module folder for the Document module which usually is in sites/all/modules or sites/all/modules/contrib.

efc84’s picture

@jacobson

Thanks for your reply, would you mind expanding your answer please as this is the first time i have installed a patch.

Where do you find the patch command?

EDIT: Just tried to install using putty on the FTP server and got 'error: No changes'

loopy1492’s picture

Yeah, I'm in the same boat. I don't have direct access to the server. Is there a way that I can apply this patch just by replacing some files through FTP?

loopy1492’s picture

Status: Active » Patch (to be ported)

Hey guys. You can do this through FTP by going to /sites/all/modules/document/ and editing the document.module and document.admin.inc as indicated in the patch. In the patch file, it gives you the line numbers that are effected. You'll notice that, for each edit, they give you what it currently is and what it should be changed to. You'll have to remove the exclamation points at the beginning of some of the lines. I think these are the lines that received changes.

It's funny. If you open the inc file in your favorite code editing software, you'll see where the missing single quote is. :)

Anyways, this worked for me. Be sure to create backups of both of these files in case you screw up and also be sure to clear Drupal's cache and run the cron.

Thanks
=A=

r_honey’s picture

Status: Patch (to be ported) » Fixed

Fixed (commit link)...
Thanks xcheng for the patch..

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.