Error Creating Feed Item Manually
| Project: | Aggregation |
| Version: | 6.x-1.8 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
I get the following error when creating a Feed Item manually in Drupal and leaving the GUID field which is not required blank.
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 ' 1, 0, 0, '')' at line 1 query: INSERT INTO aggregation_item (nid, url, aggregation_item_options, original_author, story_guid, fid, image_id, image_guid, original_comments) VALUES (319, 'http://www.seattlewebgroup.com', 'a:2:{s:20:\"link_to_original_url\";s:1:\"1\";s:24:\"link_to_original_comment\";s:1:\"0\";}', 'Test Testly', , 1, 0, 0, '') in D:\internet\xampp\htdocs\clientroot\CommercialCondos\homepage\webroot\sites\all\modules\aggregation\aggregation.module on line 958.
As a temporary workaround I've changed the function aggregation_item_insert as follows:
function aggregation_item_insert($node)
{
if (is_null($node->story_guid) || empty($node->story_guid))
$node->story_guid = 0;
db_query("INSERT INTO {aggregation_item} (nid, url, aggregation_item_options, original_author, ".
"story_guid, fid, image_id, image_guid, original_comments) VALUES (%d, '%s', '%s', '%s', %s, %d, ".
"%d, %s, '%s')", $node->nid, $node->url, $node->aggregation_item_options, $node->original_author, $node->story_guid, $node->fid, $node->image_id, $node->image_guid ? $node->image_guid : 0, $node->original_comments);
}
