symphonycms/selectbox_link_field — Issue #12: Broken caching/entry retrieval
Author: designermonkey
Created: 2011-10-23 19:46:52+00:00
State: open

Every time I try to use this field to link/retrieve entries that have `'` (apostrophe) it breaks...

It always seems to be the caching SQL that breaks, so I don't know if it is this field itself, or the core MySQL class...

```
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 ')' at line 4
An error occurred while attempting to execute the following query
SELECT SQL_CACHE e.id, e.section_id, s.name, s.handle FROM `sym_entries` AS `e` LEFT JOIN `sym_sections` AS `s` ON (s.id = e.section_id) WHERE e.id IN ()
Backtrace:
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/lib/toolkit/class.mysql.php:463] MySQL->__error();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/lib/toolkit/class.mysql.php:609] MySQL->query();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/extensions/selectbox_link_field/fields/field.selectbox_link.php:233] MySQL->fetch();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/extensions/selectbox_link_field/fields/field.selectbox_link.php:474] fieldSelectBox_Link->findRelatedValues();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/extensions/reflectionfield/extension.driver.php:102] fieldSelectBox_Link->appendFormattedElement();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/extensions/reflectionfield/fields/field.reflection.php:263] Extension_ReflectionField->getXPath();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/extensions/reflectionfield/extension.driver.php:131] FieldReflection->compile();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/lib/toolkit/class.extensionmanager.php:559] Extension_ReflectionField->compileBackendFields();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/content/content.publish.php:897] ExtensionManager->notifyMembers();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/content/content.publish.php:40] contentPublish->__actionEdit();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/content/content.publish.php:26] contentPublish->__switchboard();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/lib/toolkit/class.administrationpage.php:242] contentPublish->action();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/lib/core/class.administration.php:230] AdministrationPage->build();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/symphony/lib/core/class.administration.php:383] Administration->__buildPage();
[/Users/designermonkey/Projects/Symphony/finances/httpdocs/index.php:25] Administration->display();
Database Query Log:
SET character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'; [0.0001]
SET CHARACTER SET 'utf8'; [0.0001]
SELECT SQL_CACHE `session_data` FROM `sym_sessions` WHERE `session` = '3ed167ef15d8d13391f100d6e9009782' LIMIT 1; [0.0002]
DELETE FROM `sym_sessions` WHERE `session_expires` <= '1318189319'; [0.0001]
SELECT SQL_CACHE `name` FROM `sym_extensions` WHERE `status` = 'enabled'; [0.0001]
SELECT SQL_CACHE `id` FROM `sym_authors` WHERE `username` = 'john-porter' AND `password` = 'b064039c12eec87b0034061bc876418a82bca30c' LIMIT 1; [0.0002]
UPDATE sym_authors SET `last_seen` = '2011-10-23 20:41:59' WHERE `id` = '1'; [0.0002]
SELECT SQL_CACHE * FROM `sym_authors` WHERE `id` IN (1) ORDER BY id ASC; [0.0001]
SELECT SQL_CACHE * FROM `sym_extensions`; [0.0003]
SELECT SQL_CACHE * FROM `sym_authors` WHERE `username` = 'john-porter' LIMIT 1; [0.0002]
SELECT SQL_CACHE * FROM `sym_sections` ORDER BY `sortorder` ASC; [0.0004]
SELECT SQL_CACHE * FROM `sym_authors` WHERE `username` = 'john-porter' LIMIT 1; [0.0002]
SELECT SQL_CACHE t1.name, t2.page, t2.delegate, t2.callback FROM `sym_extensions` as t1 INNER JOIN `sym_extensions_delegates` as t2 ON t1.id = t2.extension_id WHERE t1.status = 'enabled'; [0.0003]
SELECT SQL_CACHE `section_id` FROM `sym_entries` WHERE `id` = '481' LIMIT 1; [0.0002]
SELECT SQL_CACHE `s`.* FROM `sym_sections` AS `s` WHERE `s`.`id` = '1'; [0.0002]
SELECT SQL_CACHE `e`.id, `e`.section_id, e.`author_id`, UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date` FROM `sym_entries` AS `e` WHERE 1 AND `e`.`id` IN ('481') AND `e`.`section_id` = '1'; [0.0002]
SELECT SQL_CACHE `id` FROM `sym_fields` WHERE `parent_section` = 1; [0.0002]
SELECT SQL_CACHE * FROM `sym_entries_data_1` WHERE `entry_id` IN (481) ORDER BY `id` ASC; [0.0001]
SELECT SQL_CACHE * FROM `sym_entries_data_2` WHERE `entry_id` IN (481) ORDER BY `id` ASC; [0.0002]
SELECT SQL_CACHE * FROM `sym_entries_data_3` WHERE `entry_id` IN (481) ORDER BY `id` ASC; [0.0001]
SELECT SQL_CACHE `id`, `element_name`, `type`, `location` FROM `sym_fields` WHERE `parent_section` = '1' ORDER BY `sortorder` ASC; [0.0001]
SELECT SQL_CACHE t1.* FROM sym_fields as t1 WHERE 1 AND t1.`id` = '1' LIMIT 1; [0.0002]
SELECT SQL_CACHE * FROM `sym_fields_input` WHERE `field_id` = '1' LIMIT 1; [0.0002]
SELECT SQL_CACHE t1.* FROM sym_fields as t1 WHERE 1 AND t1.`id` = '2' LIMIT 1; [0.0002]
SELECT SQL_CACHE * FROM `sym_fields_selectbox_link` WHERE `field_id` = '2' LIMIT 1; [0.0002]
SELECT SQL_CACHE t1.* FROM sym_fields as t1 WHERE 1 AND t1.`id` = '3' LIMIT 1; [0.0002]
SELECT SQL_CACHE * FROM `sym_fields_reflection` WHERE `field_id` = '3' LIMIT 1; [0.0002]
SELECT SQL_CACHE `id`, `element_name`, `type`, `location` FROM `sym_fields` WHERE `parent_section` = '1' ORDER BY `sortorder` ASC; [0.0002]
SELECT SQL_CACHE t1.* FROM sym_fields as t1 WHERE 1 AND t1.`parent_section` = '1' ORDER BY t1.`sortorder` ASC; [0.0002]
DELETE FROM sym_entries_data_1 WHERE `entry_id` = '481'; [0.0002]
INSERT INTO `sym_entries_data_1` (`entry_id`, `value`, `handle`) VALUES ('481', 'Mama Tai\'s', 'mama-tais'); [0.0002]
DELETE FROM sym_entries_data_2 WHERE `entry_id` = '481'; [0.0002]
INSERT INTO `sym_entries_data_2` (`entry_id`, `relation_id`) VALUES ('481', NULL); [0.0001]
DELETE FROM sym_entries_data_3 WHERE `entry_id` = '481'; [0.0002]
INSERT INTO `sym_entries_data_3` (`entry_id`, `handle`, `value`, `value_formatted`) VALUES ('481', NULL, NULL, NULL); [0.0002]
SELECT SQL_CACHE * FROM `sym_sections_association` AS `sa`, `sym_sections` AS `s` WHERE `sa`.`parent_section_id` = 1 AND `s`.`id` = `sa`.`child_section_id` ORDER BY `s`.`sortorder` ASC; [0.0002]
SELECT SQL_CACHE COUNT(*) as `count` FROM `sym_entries_data_2` WHERE `relation_id` = 481; [0.0002]
SELECT SQL_CACHE s.handle FROM `sym_sections` AS s WHERE s.id = '1' LIMIT 1; [0.0001]
SELECT SQL_CACHE t1.* FROM sym_fields as t1 WHERE 1 AND id IN (3) ORDER BY t1.`sortorder` ASC; [0.0002]
SELECT SQL_CACHE e.id, e.section_id, s.name, s.handle FROM `sym_entries` AS `e` LEFT JOIN `sym_sections` AS `s` ON (s.id = e.section_id) WHERE e.id IN (); [0.0000]
```