Closed animaux closed 9 years ago
The only way I've fixed it for now was to wrap this SQL statement in a try catch block.
Still trying to figure out a better solution, but was not able to check if the index exists before dropping it.
cc @jonmifsud
I get yet another mySQL Error on a fresh Symphony 2.6.2 install:
Symphony Fatal Database 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 '' at line 3
An error occurred while attempting to execute the following query
SELECT SQL_CACHE value, field_ FROM sym_entries_data_20 WHERE entry_id=
[/www/htdocs/…/2015/symphony/lib/toolkit/class.mysql.php:556]
MySQL->__error();
[/www/htdocs/…/2015/symphony/lib/toolkit/class.mysql.php:772]
MySQL->query();
[/www/htdocs/…/2015/extensions/order_entries/fields/field.order_entries.php:52]
MySQL->fetch();
[/www/htdocs/…/2015/symphony/lib/toolkit/class.entry.php:182]
fieldOrder_Entries->processRawFieldData();
[/www/htdocs/…/2015/symphony/content/content.publish.php:988]
Entry->setDataFromPost();
[/www/htdocs/…/2015/symphony/content/content.publish.php:349]
contentPublish->__viewNew();
[/www/htdocs/…/2015/symphony/content/content.publish.php:354]
contentPublish->__switchboard();
[/www/htdocs/…/2015/symphony/lib/toolkit/class.administrationpage.php:465]
contentPublish->view();
[/www/htdocs/…/2015/symphony/content/content.publish.php:320]
AdministrationPage->build();
[/www/htdocs/…/2015/symphony/lib/core/class.administration.php:212]
contentPublish->build();
[/www/htdocs/…/2015/symphony/lib/core/class.administration.php:490]
Administration->__buildPage();
[/www/htdocs/…/2015/symphony/lib/boot/func.utilities.php:232]
Administration->display();
[/www/htdocs/…/2015/symphony/lib/boot/func.utilities.php:212]
symphony_launcher();
[/www/htdocs/…/2015/index.php:17]
symphony();
[0.0001] SET character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8';
[0.0000] SET CHARACTER SET 'utf8';
[0.0001] SET time_zone = '+02:00';
[0.0004] 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' ORDER BY t2.delegate, t1.name;
[0.0001] SELECT SQL_CACHE `name` FROM `sym_extensions` WHERE `status` = 'enabled';
[0.0002] SELECT SQL_CACHE `session_data` FROM `sym_sessions` WHERE `session` = '2d6b80462cfe74ed18f290605c6a3bd5' LIMIT 1;
[0.0001] SELECT SQL_CACHE a.* FROM `sym_authors` AS `a` WHERE `username` = 'alex' ORDER BY a.id ASC LIMIT 1;
[0.0001] UPDATE sym_authors SET `last_seen` = '2015-07-23 20:48:00' WHERE `id` = 1;
[0.0001] SELECT SQL_CACHE * FROM `sym_extensions`;
[0.0002] SELECT SQL_CACHE `id` FROM `sym_sections` WHERE `handle` = 'projekte' LIMIT 1;
[0.0002] SELECT SQL_CACHE * FROM `sym_sections_association` AS `sa`, `sym_sections` AS `s` WHERE `sa`.`child_section_id` = 1 AND `s`.`id` = `sa`.`parent_section_id` ORDER BY `s`.`sortorder` ASC;
[0.0000] 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 `s`.* FROM `sym_sections` AS `s` ORDER BY `s`.`sortorder` asc;
[0.0001] SELECT SQL_CACHE d.pages, d.id FROM `sym_documentation` AS d ORDER BY d.pages ASC;
[0.0001] SELECT SQL_CACHE `id` FROM `sym_sections` WHERE `handle` = 'projekte' LIMIT 1;
[0.0001] SELECT SQL_CACHE COUNT(*) FROM `sym_entries` WHERE `section_id` = '1';
[0.0001] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(20);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_order_entries` WHERE `field_id` IN (20);
[0.0001] SELECT SQL_CACHE `e`.id, `e`.section_id, e.`author_id`, UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`, UNIX_TIMESTAMP(e.`modification_date`) AS `modification_date` FROM `sym_entries` AS `e` LEFT OUTER JOIN `sym_entries_data_20` AS `ed` ON (`e`.`id` = `ed`.`entry_id`) WHERE 1 AND `e`.`section_id` = 1 ORDER BY `ed`.`value` asc LIMIT 0, 1;
[0.0001] SELECT SQL_CACHE `id`, `element_name`, `type`, `location` FROM `sym_fields` WHERE `parent_section` = 1 ORDER BY `sortorder` ASC;
[0.0000] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(1);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_input` WHERE `field_id` IN (1);
[0.0000] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(2);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_input` WHERE `field_id` IN (2);
[0.0000] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(3);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_checkbox` WHERE `field_id` IN (3);
[0.0001] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(4);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_taglist` WHERE `field_id` IN (4);
[0.0001] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 4;
[0.0000] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(5);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_textarea` WHERE `field_id` IN (5);
[0.0001] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(9);
[0.0001] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (9);
[0.0000] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 9;
[0.0000] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(10);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (10);
[0.0000] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 10;
[0.0000] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`id` IN(11);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (11);
[0.0000] SELECT SQL_CACHE CASE hide_association WHEN "no" THEN "yes" ELSE "no" END as show_association FROM `sym_sections_association` WHERE `child_section_field_id` = 11;
[0.0001] SELECT SQL_CACHE `id` FROM `sym_sections` WHERE `handle` = 'projekte' LIMIT 1;
[0.0001] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`location` = 'sidebar' AND t1.`parent_section` = '1' ORDER BY t1.`sortorder` ASC;
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_checkbox` WHERE `field_id` IN (3);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_taglist` WHERE `field_id` IN (4);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_order_entries` WHERE `field_id` IN (20);
[0.0000] SELECT SQL_CACHE t1.* FROM sym_fields AS `t1` WHERE 1 AND t1.`location` = 'main' AND t1.`parent_section` = '1' ORDER BY t1.`sortorder` ASC;
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_input` WHERE `field_id` IN (1,2);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_textarea` WHERE `field_id` IN (5);
[0.0000] SELECT SQL_CACHE * FROM `sym_fields_association` WHERE `field_id` IN (9,10,11);
[0.0000] SELECT SQL_CACHE `id`, `element_name`, `type`, `location` FROM `sym_fields` WHERE `parent_section` = 1 ORDER BY `sortorder` ASC;
[0.0005] SHOW COLUMNS FROM sym_entries_data_20 WHERE Field like 'field_%';;
Looking into PMA I also found the extension creates columns using swedish encoding instead of unicode …
Will have to check later. It’s worth noting that the error only occurs on entry creation/saving when required fields are not filled.
Removing the code you mentioned seems to work for me! Thanks!
Ok great.
After updating from 2.1.x to 2.2.1 I get the following error while trying to save a section containing sort_order: