Index: branches/5.2.x/units/poll_comments/poll_comments_config.php =================================================================== diff -u -r15008 -r15559 --- branches/5.2.x/units/poll_comments/poll_comments_config.php (.../poll_comments_config.php) (revision 15008) +++ branches/5.2.x/units/poll_comments/poll_comments_config.php (.../poll_comments_config.php) (revision 15559) @@ -1,6 +1,6 @@ Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'AnswerId' => Array ('type' => 'int', 'default' => NULL), - 'CreatedById' => Array ('type' => 'int', 'formatter'=>'kLEFTFormatter', - 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), - 'options' => Array(USER_ROOT => 'root', USER_GUEST => 'Guest'), - 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Users WHERE `%s` = \'%s\'', - 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Username', - 'required' => 1, 'default' => NULL), + 'CreatedById' => Array ( + 'type' => 'int', + 'formatter'=>'kLEFTFormatter', + 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), + 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), + 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users WHERE %s', + 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, + 'required' => 1, 'default' => NULL + ), 'GuestName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''), 'GuestEmail' => Array('type' => 'string', 'max_len' => 255, 'formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', 'sample_value' => 'email@domain.com', 'not_null' => '1', 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!', 'unique'=>'!lu_email_already_exist!'),'required' => 0 ), 'CommentBody' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL, 'required' => 1), @@ -81,7 +84,7 @@ 'CalculatedFields' => Array ( '' => Array ( - 'CommentedByUser' => 'IF( ISNULL(pu.Username), IF (%1$s.CreatedById = ' . USER_ROOT . ', \'root\', IF (%1$s.CreatedById = ' . USER_GUEST . ', \'Guest\', \'n/a\')), pu.Username )', + 'CommentedByUser' => 'IF( ISNULL(pu.Username), IF (%1$s.CreatedById = ' . USER_ROOT . ', \'root\', IF (%1$s.CreatedById = ' . USER_GUEST . ', \'Guest\', \'n/a\')), IF(pu.Username = "", pu.Email, pu.Username))', ), ),