0 users online. Create an account or sign in to join them.Users

Announcement

Symphony's issue tracker has been moved to Github.

Issues are displayed here for reference only and cannot be created or edited.

Browse

Closed#180: Adding author field results in `Symphony Recoverable Error`

I just added an author field to a section and now I’m getting the following error when trying to access the section:

Object of class Administration could not be converted to string An error occurred in /www/htdocs/webseiten/hananils/symphony/lib/toolkit/class.author.php around line 19

14:         }
15:         
16:         public function loadAuthor($id){
17:             if(!is_object(Symphony::Database())) return false;
18:             
19:             if(!$row = Symphony::Database()->fetchRow(0, "SELECT * FROM `sym_authors` WHERE `id` = '$id' LIMIT 1")) return false;
20:             
21:             foreach($row as $key => $val)
22:                 $this->set($key, $val);
23:

Backtrace:

[/www/htdocs/webseiten/hananils/symphony/lib/toolkit/class.author.php:19] GenericErrorHandler::handler();
[/www/htdocs/webseiten/hananils/symphony/lib/toolkit/class.author.php:13] Author->loadAuthor();
[/www/htdocs/webseiten/hananils/symphony/lib/toolkit/fields/field.author.php:91] Author->__construct();
[/www/htdocs/webseiten/hananils/symphony/content/content.publish.php:211] fieldAuthor->prepareTableValue();
[/www/htdocs/webseiten/hananils/symphony/content/content.publish.php:29] contentPublish->__viewIndex();
[/www/htdocs/webseiten/hananils/symphony/content/content.publish.php:34] contentPublish->__switchboard();
[/www/htdocs/webseiten/hananils/symphony/lib/toolkit/class.administrationpage.php:81] contentPublish->view();
[/www/htdocs/webseiten/hananils/symphony/lib/core/class.administration.php:88] AdministrationPage->build();
[/www/htdocs/webseiten/hananils/symphony/lib/core/class.administration.php:204] Administration->__buildPage();
[/www/htdocs/webseiten/hananils/index.php:20] Administration->display();

Database Query Log:

SET NAMES 'utf8'; [0.0002]
SET CHARACTER SET 'utf8'; [0.0001]
SELECT SQL_NO_CACHE * FROM `sym_cache` WHERE `hash` = '_session_config' AND (`expiry` IS NULL OR UNIX_TIMESTAMP() <= `expiry`) LIMIT 1; [0.0006]
SELECT `session_data` FROM `sym_sessions` WHERE `session` = '90b8fb27303688f8fe2fd20c5ec8de54' LIMIT 1; [0.0008]
SELECT `id` FROM `sym_authors` WHERE `username` = 'Nils' AND `password` = '98e16bd8c65cdf2c289fd222f2e229db' LIMIT 1; [0.0008]
UPDATE sym_authors SET `last_seen` = '2010-01-01 19:02:23' WHERE `id` = '1'; [0.0004]
SELECT * FROM `sym_authors` WHERE `id` = '1' LIMIT 1; [0.0002]
SELECT * FROM `sym_sections` ORDER BY `sortorder` ASC; [0.0004]
SELECT `name` FROM `sym_extensions` WHERE `status` = 'enabled'; [0.0003]
SELECT `status` FROM `sym_extensions` WHERE `name` = 'debugdevkit' LIMIT 1; [0.0003]
SELECT `version` FROM `sym_extensions` WHERE `name` = 'debugdevkit' LIMIT 1; [0.0002]
SELECT `status` FROM `sym_extensions` WHERE `name` = 'export_ensemble' LIMIT 1; [0.0003]
SELECT `version` FROM `sym_extensions` WHERE `name` = 'export_ensemble' LIMIT 1; [0.0002]
SELECT `status` FROM `sym_extensions` WHERE `name` = 'selectbox_link_field' LIMIT 1; [0.0003]
SELECT `version` FROM `sym_extensions` WHERE `name` = 'selectbox_link_field' LIMIT 1; [0.0002]
SELECT `status` FROM `sym_extensions` WHERE `name` = 'jit_image_manipulation' LIMIT 1; [0.0003]
SELECT `version` FROM `sym_extensions` WHERE `name` = 'jit_image_manipulation' LIMIT 1; [0.0002]
SELECT `status` FROM `sym_extensions` WHERE `name` = 'maintenance_mode' LIMIT 1; [0.0003]
SELECT `version` FROM `sym_extensions` WHERE `name` = 'maintenance_mode' LIMIT 1; [0.0002]
SELECT `status` FROM `sym_extensions` WHERE `name` = 'markdown' LIMIT 1; [0.0003]
SELECT `version` FROM `sym_extensions` WHERE `name` = 'markdown' LIMIT 1; [0.0002]
SELECT `status` FROM `sym_extensions` WHERE `name` = 'profiledevkit' LIMIT 1; [0.0003]
SELECT `version` FROM `sym_extensions` WHERE `name` = 'profiledevkit' LIMIT 1; [0.0002]
SELECT t1.*, t2.callback FROM `sym_extensions` as t1 LEFT JOIN `sym_extensions_delegates` as t2 ON t1.id = t2.extension_id WHERE (t2.page IN ('backend', '/backend/', 'administration', '/administration/', '*')) AND t2.delegate = 'ExtensionsAddToNavigation' AND t1.status = 'enabled'; [0.0002]
SELECT t1.*, t2.callback FROM `sym_extensions` as t1 LEFT JOIN `sym_extensions_delegates` as t2 ON t1.id = t2.extension_id WHERE (t2.page IN ('backend', '/backend/', 'administration', '/administration/', '*')) AND t2.delegate = 'InitaliseAdminPageHead' AND t1.status = 'enabled'; [0.0003]
SELECT t1.*, t2.callback FROM `sym_extensions` as t1 LEFT JOIN `sym_extensions_delegates` as t2 ON t1.id = t2.extension_id WHERE (t2.page IN ('backend', '/backend/', 'administration', '/administration/', '*')) AND t2.delegate = 'NavigationPreRender' AND t1.status = 'enabled'; [0.0003]
SELECT * FROM `sym_extensions_delegates` WHERE `delegate` = 'AddCustomPreferenceFieldsets'; [0.0004]
SELECT `id` FROM `sym_sections` WHERE `handle` = 'texte' LIMIT 1; [0.0002]
SELECT `s`.*, count(`e`.`id`) as `entry_count` FROM `sym_sections` AS `s` LEFT JOIN `sym_entries` AS `e` ON `s`.id = `e`.`section_id` WHERE `s`.`id` = '2' GROUP BY `s`.id; [0.0002]
SELECT sym_authors.* FROM sym_authors GROUP BY sym_authors.id ORDER BY sym_authors.id ASC; [0.0008]
SELECT t1.* FROM sym_fields as t1 WHERE 1 AND t1.`type` = 'sectionlink' AND t1.`parent_section` = '2' ORDER BY t1.`sortorder` ASC; [0.0002]
SELECT `e`.id, `e`.section_id, e.`author_id`, UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`, UNIX_TIMESTAMP(e.`creation_date_gmt`) AS `creation_date_gmt` FROM `sym_entries` AS `e` WHERE 1 AND `e`.`section_id` = '2' ORDER BY `e`.`id` DESC LIMIT 0, 17; [0.0002]
SELECT * FROM `sym_fields` WHERE `parent_section` = 2; [0.0005]
SELECT * FROM `sym_entries_data_2` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_9` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_10` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_11` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_12` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_13` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_14` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_15` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_16` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT * FROM `sym_entries_data_17` WHERE `entry_id` IN ('1') ORDER BY `id` ASC; [0.0002]
SELECT count(`e`.id) as `count` FROM `sym_entries` AS `e`    WHERE 1 AND `e`.`section_id` = '2'; [0.0002]
SELECT t1.* FROM sym_fields as t1 WHERE 1 AND t1.`parent_section` = '2' AND t1.show_column = 'yes' ORDER BY t1.`sortorder` ASC; [0.0003]
SELECT * FROM `sym_fields_input` WHERE `field_id` = '2' LIMIT 1; [0.0004]
SELECT * FROM `sym_fields_input` WHERE `field_id` = '10' LIMIT 1; [0.0002]
SELECT * FROM `sym_fields_select` WHERE `field_id` = '12' LIMIT 1; [0.0003]
SELECT * FROM `sym_fields_author` WHERE `field_id` = '16' LIMIT 1; [0.0003]
SELECT * FROM `sym_fields_checkbox` WHERE `field_id` = '17' LIMIT 1; [0.0003]
SELECT * FROM `sym_fields_checkbox` WHERE `field_id` = '15' LIMIT 1; [0.0002]
SELECT * FROM `sym_sections_association` AS `sa`, `sym_sections` AS `s` WHERE `sa`.`parent_section_id` = '2' AND `s`.`id` = `sa`.`child_section_id` ORDER BY `s`.`sortorder` ASC; [0.0002]

This problem does only occur when I use the Show Column option.

This bug has always been there, and only shows up when there is no Author data saved with an entry (such as adding the field to an existing section or saving with a NULL value). However, since it was a recoverable error, Symphony never did anything about it. The new GenericError and GenericException handler classes, as of 2.0.7, aren’t as forgiving (as it should have been from the start).

I have fixed the bug, and the commit can be seen here. Thanks for spotting it.

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details