Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
A fatal, non-recoverable error has occurred -- Attachments mod
Notice: Undefined index: Attachment in /home/ingero/public_html/x/clientarea/library/Framework/Framework.Functions.php on line 549
Notice: Undefined index: Attachment in /home/ingero/public_html/x/clientarea/library/Framework/Framework.Class.SqlBuilder.php on line 129 (This line repeats a bunch)
Notice: Undefined index: Attachment in /home/ingero/public_html/x/clientarea/library/Framework/Framework.Class.SqlBuilder.php on line 263
A fatal, non-recoverable error has occurred
Technical information (for support personel):
Error Message
An error occurred while retrieving attachments.
Affected Elements
AttachmentManager.RetrieveAttachments();
The error occurred on or near: 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 'as AttachmentID, a. as UserID, a. as DiscussionID, a. as CommentID, a. as Ti' at line 1
I get this error trying to open a discussion. Once I turn the attachments mod off, everything goes back to normal. If I install the old version of attachments, I don't get these errors, BUT, I can't get attachments to save (and I know my permissions are not the issue, I've checked the permissions sevenfold and there should be no problem) ... and by the way, I did check out the attachments thread and couldn't find an answer, but maybe I wasn't looking hard enough??
Also, not sure if it matters, but I did merge Vanilla's user tables with Wordpress.
Notice: Undefined index: Attachment in /home/ingero/public_html/x/clientarea/library/Framework/Framework.Class.SqlBuilder.php on line 129 (This line repeats a bunch)
Notice: Undefined index: Attachment in /home/ingero/public_html/x/clientarea/library/Framework/Framework.Class.SqlBuilder.php on line 263
A fatal, non-recoverable error has occurred
Technical information (for support personel):
Error Message
An error occurred while retrieving attachments.
Affected Elements
AttachmentManager.RetrieveAttachments();
The error occurred on or near: 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 'as AttachmentID, a. as UserID, a. as DiscussionID, a. as CommentID, a. as Ti' at line 1
I get this error trying to open a discussion. Once I turn the attachments mod off, everything goes back to normal. If I install the old version of attachments, I don't get these errors, BUT, I can't get attachments to save (and I know my permissions are not the issue, I've checked the permissions sevenfold and there should be no problem) ... and by the way, I did check out the attachments thread and couldn't find an answer, but maybe I wasn't looking hard enough??
Also, not sure if it matters, but I did merge Vanilla's user tables with Wordpress.
0
This discussion has been closed.
Comments
Basically, I deleted Attachments2.1 from my server, redownloaded the file. I changed all accounts of MineType to MimeType in default.php. Attachments2.1 was not creating my LUM_Attachments table in my database. So, I manually created it in phpMyAdmin by pasting the following code in the SQL box in my Vanilla Database:
CREATE TABLE `LUM_Attachment` (
`AttachmentID` int(11) NOT NULL auto_increment,
`UserID` int(11) NOT NULL default '0',
`DiscussionID` int(11) NOT NULL default '0',
`CommentID` int(11) NOT NULL default '0',
`Title` varchar(200) NOT NULL default '',
`Description` text NOT NULL,
`Name` varchar(200) NOT NULL default '',
`Path` text NOT NULL,
`Size` int(11) NOT NULL default '0',
`MimeType` varchar(200) NOT NULL default '',
`DateCreated` datetime NOT NULL default '0000-00-00 00:00:00',
`DateModified` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`AttachmentID`)
)
After that, I copy and pasted the following code from default.php (taking out the slashes at the front of every line before the $) into /vanilla/conf/database.php
// Attachments Table Structure
$DatabaseTables['Attachment'] = 'Attachment';
$DatabaseColumns['Attachment']['AttachmentID'] = 'AttachmentID';
$DatabaseColumns['Attachment']['UserID'] = 'UserID';
$DatabaseColumns['Attachment']['DiscussionID'] = 'DiscussionID';
$DatabaseColumns['Attachment']['CommentID'] = 'CommentID';
$DatabaseColumns['Attachment']['Title'] = 'Title';
$DatabaseColumns['Attachment']['Description'] = 'Description';
$DatabaseColumns['Attachment']['Name'] = 'Name';
$DatabaseColumns['Attachment']['Path'] = 'Path';
$DatabaseColumns['Attachment']['Size'] = 'Size';
$DatabaseColumns['Attachment']['MimeType'] = 'MimeType';
$DatabaseColumns['Attachment']['DateCreated'] = 'DateCreated';
$DatabaseColumns['Attachment']['DateModified'] = 'DateModified';
I double checked my file permissions on my upload directory. I made the following folders 0777:
/vanilla/upload
/vanilla/upload/Attachments
So far, everything seems to be working. I tried peeking in my Attachments folder after I uploaded a file and I don't see it there, but when I go on the forum, the file is definitely there, so I don't know what that means.
EDIT -- I also wanted to mention that the /vanilla/upload/Attachments folder is completely useless unless you have it written in your path on the Attachment Setting page.
The MineType occurences and the fix in database.php was what I was missing :P
Take care
I changed the default.php from MineType to MimeType (I believe there were three references).
The LUM_Attachment table was being created, but I hosed it and remade another one with your above SQL statement.
And this is my database.php:
<?php // Database Configuration Settings $Configuration['DATABASE_HOST'] = 'localhost'; $Configuration['DATABASE_NAME'] = 'REMOVED'; $Configuration['DATABASE_USER'] = 'REMOVED'; $Configuration['DATABASE_PASSWORD'] = 'REMOVED'; $Configuration['DATABASE_CHARACTER_ENCODING'] = 'utf8'; $DatabaseTables['User'] = 'LUM_User'; // UserRole Table Structure^M $DatabaseTables['UserRole'] = 'UserRole';^M $DatabaseColumns['UserRole']['UserID'] = 'UserID';^M $DatabaseColumns['UserRole']['RoleID'] = 'RoleID';^M $DatabaseColumns['UserRole']['Activated'] = 'Activated';^M ^M // Multi Role 2.0 Table Structure^M $DatabaseColumns['CategoryRoleBlock']['MultiRoles_ReadOnly'] = 'MultiRoles_ReadOnly';^M $DatabaseColumns['Comment']['BlogThis'] = 'BlogThis';?> // Attachments Table Structure $DatabaseTables['Attachment'] = 'Attachment'; $DatabaseColumns['Attachment']['AttachmentID'] = 'AttachmentID'; $DatabaseColumns['Attachment']['UserID'] = 'UserID'; $DatabaseColumns['Attachment']['DiscussionID'] = 'DiscussionID';
Note the lack of trailing ?> - I removed it because before adding the Attachments mod, it didn't have one, and the fact that if one is there the extensions page keeps doing those stupid pop ups when you enable/disable extensions.
This is my upload folder. I have changed the path in Attachments settings to reflect its location.
4 drwxrwxrwx 3 www-data www-data 4096 2008-02-18 12:33 upload
I'm really stumped as to why it's not working.