Acidfree SQL Errors
Just posted to the Drupal.org site:
I don't want to submit an issue on Acidfree until I'm sure that I'm not making some foolish mistake, so I'll ask here first.
I have successfully installed Acidfree 4.6.0 into a working 4.6.0 drupal site. I've applied its patch to the filemanager module, created its mysql tables and verified their existence and proper load, enabled the module, set the accesses, and attempted to use it.
Upon creating a new Acidfree album, it appears in "content" as an "Acidfree media"-type node. Attempting then to add a photo, the photo uploads and appears as a Drupal node, but it is not tied to the Acidfree media album. Upon accessing the photo, the following two SQL errors appear:
---
user error: 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 '&& class!='album'' at line 1
query: SELECT COUNT(*) FROM acidfree_hierarchy INNER JOIN acidfree ON child = aid WHERE parent = && class!='album' in /var/www/localhost/htdocs/includes/database.mysql.inc on line 66.
user error: 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 '&& class!='album' ORDER BY weight ASC, aid ASC LIMIT 0, 1' at l
query: SELECT child FROM acidfree_hierarchy INNER JOIN acidfree ON child = aid WHERE parent = && class!='album' ORDER BY weight ASC, aid ASC LIMIT 0, 1 in /var/www/localhost/htdocs/includes/database.mysql.inc on line 66.
---
You can see the errors live at:
https://www.felix.org/node/15562&pid=&from=0,0
I can find no reference to this in the forums, and I will continue to try local troubleshooting. I am new to Drupal, though, and if someone more experienced has any thoughts to steer my work, I would most appreciate the help.
RF

Maintainer comment:
Updates
#1 submitted by vhmauery on October 3, 2005 - 07:59
I just set up a new sandbox to play in so I could start from scratch. I could not duplicate this bug.
What happens if you clean up and start over?
Mysql cleanup:
truncate acidfree; truncate acidfree_hierarchy; delete from node where type='acidfree'; delete from file where area='acidfree';
If acidfree is the only thing using the filemanager, you can just delete the working and active directories.
Now when you try again, does it do the same thing?
As for things showing up in recent posts, is acidfree stuff set to be promoted to the front page, or am I not understanding?
Trying from Scratch
I have executed cleanup as you describe, and the filemanager module has been patched properly. I have unpacked the acidfree-4.6.0 tar file in to my modules subdirectory and modified the owner as apache:apache. Now:
1. I enable the acidfree module (no throttling).
2. I check acidfree settings. I see that the "Location of acidfree media" setting asks for a relative path from my sites/files directory. I have no sites/files directory, so I create one at htdocs/sites/files and another acidfree directory at htdocs/sites/files/acidfree. This may have been an issue before, as my "files" directory is under htdocs, not sites. I set ownership to apache:apache for both new directories. I leave the setting as "acidfree" with no trailing slash and change no other settings.
3. I set access control for registered users to import, create albums and elements, and edit own elements.
4. I attempt to create new content - an album. I get the "first use" notice that: No Acidfree root album found, created new root -- node 15588. I then create a new album as node 15589.
5. All seems to be working. I create a sub-album and add five pictures. Now, though, when clicking on a picture thumbnail, I get the following SQL error:
user error: 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 'DISTINCT(n.nid) = '15590from=0,2'' at line 1
query: SELECT n.*, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid WHERE DISTINCT(n.nid) = '15590from=0,2' in /var/www/localhost/htdocs/includes/database.mysql.inc on line 66.
warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/includes/common.inc:384) in /var/www/localhost/htdocs/includes/common.inc on line 192.
The URL in question is:
https://www.felix.org/node/15593&pid=15590from=0,2
I can fix it manually by adding an ampersand before "from":
https://www.felix.org/node/15593&pid=15590&from=0,2
Enough for now -- will hit this again later.
Post new comment