[0.3.0_328] Clear_dir truncation

A signature and avatar generator addon

Moderator: zanix

[0.3.0_328] Clear_dir truncation

Postby shaun.voysey » Sat Dec 29, 2007 9:26 pm

Just upgraded everything on my server. PHP and MySQL to the Latest FULL releases. (PHP 5.2.5, MySQL 5.0.45) So this is a clean database install.

I have managed to get my Main roster up and running, a few niggles here and there that I sorted. (mainly a dodgy data for a characters 'Ranged_dps' that was set to 1.$ in cp).

Now for the Siggen. This following error appears when I save the config. I do not have to have changed anything, just hit save. :(

What strikes me as interesting, is that clear_dir is a TINYINT. ie a binary switch, on or off. so why is there a / in the command "...`clear_dir` = '1/' WHERE..."
Its set to one because I use phpmyadmin to modify the value to see if that cahnged the outcome. Needless to say...

Happy hunting :D


1265: Data truncated for column 'clear_dir' at row 1
SQL:
UPDATE `roster_addons_siggen_config` SET `image_type` = 'jpg', `clear_dir` = '1/' WHERE `config_id` = 'signature'
File: lib\dbal\mysql.php
Line: 207
Backtrace (most recent call last):

* lib\functions.lib.php
o Line: 240
o Function Called: backtrace
* lib\dbal\mysql.php
o Line: 207
o Function Called: die_quietly
o Arguments:
+ 1265: Data truncated for column 'clear_dir' at row 1
+ Database Error
+ C:\Web Site Content HTTP Root\VoyseyS\PublicWoW\lib\dbal\mysql.php
+ 207
+ UPDATE `roster_addons_siggen_config` SET `image_type` = 'jpg', `clear_dir` = '1/' WHERE `config_id` = 'signature'
* addons\siggen\inc\functions.inc
o Line: 707
o Function Called: query
o Arguments:
+ UPDATE `roster_addons_siggen_config` SET `image_type` = 'jpg', `clear_dir` = '1/' WHERE `config_id` = 'signature'
* addons\siggen\admin\index.php
o Line: 158
o Function Called: processData
o Arguments:
+ Array ( [sc_op] => process [main_image_size_w] => 400 [main_image_size_h] => 85 [image_dir] => img/ [char_dir] => character/default/ [class_dir] => class/rounded/ [backg_dir] => background/defaultsig/ [user_dir] => members/ [pvplogo_dir] => pvp/default/ [frame_dir] => frame/ [level_dir] => level/ [border_dir] => border/ [font_dir] => fonts/ [link_type] => default [image_order] => char:frames:border:lvl:pvp:class [default_message] => SigGen Works [etag_cache] => 1 [image_type] => jpg [image_quality] => 85 [gif_dither] => 1 [save_images] => 0 [save_images_dir] => %ssig/ [save_only_mode] => 0 [save_prefix] => [save_suffix] => [trigger] => 0 [guild_trigger] => 0 [clear_dir] => 1 [uniup_compat] => 0 [backg_disp] => 1 [backg_fill] => 0 [backg_fill_color] => #000000 [outside_border_image] => sig-black.png [frames_image] => default.png [backg_default_image] => default.png [backg_force_default] => 0 [backg_data_table] => players [backg_data] => race [backg_translate] => 1 [backg_search_1] => Night Elf [backg_file_1] => darnassus.png [backg_search_2] => Human [backg_file_2] => stormwind.png [backg_search_3] => Gnome [backg_file_3] => ironforge.png [backg_search_4] => Dwarf [backg_file_4] => ironforge.png [backg_search_5] => Orc [backg_file_5] => orgrimmar.png [backg_search_6] => Troll [backg_file_6] => orgrimmar.png [backg_search_7] => Tauren [backg_file_7] => thunderbluff.png [backg_search_8] => Undead [backg_file_8] => undercity.png [backg_search_9] => Draenei [backg_file_9] => exodar.png [backg_search_10] => Blood Elf [backg_file_10] => silvermoon.png [backg_search_11] => [backg_file_11] => [backg_search_12] => [backg_file_12] => [expbar_disp] => 1 [expbar_disp_bdr] => 0 [expbar_disp_inside] => 1 [expbar_max_disp] => 1 [expbar_max_level] => 70 [expbar_max_hidden] => 1 [expbar_loc_x] => 25 [expbar_loc_y] => 73 [expbar_length] => 100 [expbar_height] => 7 [expbar_disp_text] => 1 [expbar_string_before] => [ [expbar_string_after] => ] [expbar_max_string] => Max XP [expbar_color_border] => #000000 [expbar_color_inside] => #FFFFFF [expbar_color_bar] => #0B9BFF [expbar_color_maxbar] => #0B9BFF [expbar_trans_border] => 0 [expbar_trans_inside] => 80 [expbar_trans_bar] => 20 [expbar_trans_maxbar] => 0 [expbar_font_name] => VERANDA.TTF [expbar_font_color] => #000000 [expbar_font_size] => 6 [expbar_text_shadow] => [expbar_align] => center [expbar_align_max] => center [lvl_disp] => 1 [lvl_image] => yellow.png [lvl_loc_x] => 2 [lvl_loc_y] => 60 [lvl_text_loc_x] => 11 [lvl_text_loc_y] => 15 [lvl_font_name] => GREY.TTF [lvl_font_color] => #FFCC66 [lvl_font_size] => 9 [lvl_text_shadow] => [skills_disp_primary] => 1 [skills_disp_secondary] => 1 [skills_disp_mount] => 1 [skills_disp_desc] => 1 [skills_disp_level] => 1 [skills_disp_levelmax] => 0 [skills_desc_loc_x] => 285 [skills_desc_loc_y] => 12 [skills_level_loc_x] => 393 [skills_level_loc_y] => 12 [skills_desc_length] => 14 [skills_desc_length_mount] => 22 [skills_align_desc] => left [skills_align_level] => right [skills_desc_linespace] => 8 [skills_level_linespace] => 8 [skills_gap] => 2 [skills_font_name] => VERANDA.TTF [skills_font_color] => #FF9900 [skills_font_size] => 7 [skills_shadow] => #000000 [charlogo_disp] => 1 [charlogo_default_image] => default-alliance.png [charlogo_loc_x] => 0 [charlogo_loc_y] => 0 [class_img_disp] => 1 [class_img_loc_x] => 90 [class_img_loc_y] => 3 [pvplogo_disp] => 0 [pvplogo_loc_x] => 98 [pvplogo_loc_y] => 38 [text_name_disp] => 1 [text_name_loc_x] => 204 [text_name_loc_y] => 42 [text_name_align] => center [text_name_font_name] => GREY.TTF [text_name_font_size] => 22 [text_name_font_color] => #0066FF [text_name_shadow] => #000000 [text_class_disp] => 1 [text_class_loc_x] => 124 [text_class_loc_y] => 38 [text_class_align] => right [text_class_font_name] => GREY.TTF [text_class_font_size] => 8 [text_class_font_color] => #99FF33 [text_class_shadow] => #000000 [text_honor_disp] => 0 [text_honor_loc_x] => 126 [text_honor_loc_y] => 68 [text_honor_align] => right [text_honor_font_name] => GREY.TTF [text_honor_font_size] => 8 [text_honor_font_color] => #99FF33 [text_honor_shadow] => #000000 [text_guildname_disp] => 1 [text_guildname_loc_x] => 204 [text_guildname_loc_y] => 67 [text_guildname_align] => center [text_guildname_font_name] => GREY.TTF [text_guildname_font_size] => 16 [text_guildname_font_color] => #FFFF66 [text_guildname_shadow] => #000000 [text_guildtitle_disp] => 1 [text_guildtitle_loc_x] => 128 [text_guildtitle_loc_y] => 18 [text_guildtitle_align] => left [text_guildtitle_font_name] => GREY.TTF [text_guildtitle_font_size] => 9 [text_guildtitle_font_color] => #FF9900 [text_guildtitle_shadow] => #000000 [text_servername_disp] => 1 [text_servername_loc_x] => 204 [text_servername_loc_y] => 79 [text_servername_align] => center [text_servername_font_name] => GREY.TTF [text_servername_font_size] => 9 [text_servername_font_color] => #99FF33 [text_servername_shadow] => #000000 [text_sitename_disp] => 1 [text_sitename_loc_x] => 394 [text_sitename_loc_y] => 79 [text_sitename_align] => right [text_sitename_remove] => 1 [text_sitename_font_name] => VERANDA.TTF [text_sitename_font_size] => 6 [text_sitename_font_color] => #FFFF66 [text_sitename_shadow] => #000000 [text_custom_disp] => 0 [text_custom_loc_x] => 394 [text_custom_loc_y] => 70 [text_custom_text] => Custom Text [text_custom_align] => right [text_custom_font_name] => VERANDA.TTF [text_custom_font_size] => 10 [text_custom_font_color] => #FFFFFF [text_custom_shadow] => #000000 [text_spec_disp] => 1 [text_spec_loc_x] => 124 [text_spec_loc_y] => 48 [text_spec_align] => right [text_spec_font_name] => GREY.TTF [text_spec_font_size] => 8 [text_spec_font_color] => #FF6600 [text_spec_shadow] => #000000 [text_talpoints_disp] => 1 [text_talpoints_loc_x] => 124 [text_talpoints_loc_y] => 58 [text_talpoints_align] => right [text_talpoints_font_name] => GREY.TTF [text_talpoints_font_size] => 7 [text_talpoints_font_color] => #CCFF33 [text_talpoints_shadow] => #000000 )
+ signature
+ Array ( [config_id] => signature [db_ver] => 1.6 [trigger] => 0 [guild_trigger] => 0 [clear_dir] => 1 [main_image_size_w] => 400 [main_image_size_h] => 85 [image_dir] => img/ [char_dir] => character/default/ [class_dir] => class/rounded/ [backg_dir] => background/defaultsig/ [user_dir] => members/ [pvplogo_dir] => pvp/default/ [frame_dir] => frame/ [level_dir] => level/ [border_dir] => border/ [font_dir] => fonts/ [link_type] => default [image_order] => char:frames:border:lvl:pvp:class [default_message] => SigGen Works [save_images] => 0 [save_only_mode] => 0 [uniup_compat] => 0 [save_prefix] => [save_suffix] => [save_images_dir] => %ssig/ [save_images_format] => png [etag_cache] => 1 [image_type] => png [image_quality] => 85 [gif_dither] => 1 [backg_disp] => 1 [backg_fill] => 0 [backg_fill_color] => #000000 [backg_default_image] => default.png [backg_force_default] => 0 [backg_data_table] => players [backg_data] => race [backg_translate] => 1 [backg_search_1] => Night Elf [backg_search_2] => Human [backg_search_3] => Gnome [backg_search_4] => Dwarf [backg_search_5] => Orc [backg_search_6] => Troll [backg_search_7] => Tauren [backg_search_8] => Undead [backg_search_9] => Draenei [backg_search_10] => Blood Elf [backg_search_11] => [backg_search_12] => [backg_file_1] => darnassus.png [backg_file_2] => stormwind.png [backg_file_3] => ironforge.png [backg_file_4] => ironforge.png [backg_file_5] => orgrimmar.png [backg_file_6] => orgrimmar.png [backg_file_7] => thunderbluff.png [backg_file_8] => undercity.png [backg_file_9] => exodar.png [backg_file_10] => silvermoon.png [backg_file_11] => [backg_file_12] => [font_fullpath] => 1 [outside_border_image] => sig-black.png [frames_image] => default.png [charlogo_disp] => 1 [charlogo_default_image] => default-alliance.png [charlogo_loc_x] => 0 [charlogo_loc_y] => 0 [class_img_disp] => 1 [class_img_loc_x] => 90 [class_img_loc_y] => 3 [pvplogo_disp] => 0 [pvplogo_loc_x] => 98 [pvplogo_loc_y] => 38 [lvl_disp] => 1 [lvl_font_name] => GREY.TTF [lvl_font_color] => #FFCC66 [lvl_font_size] => 9 [lvl_text_shadow] => [lvl_loc_x] => 2 [lvl_loc_y] => 60 [lvl_text_loc_x] => 11 [lvl_text_loc_y] => 15 [lvl_image] => yellow.png [expbar_disp] => 1 [expbar_disp_bdr] => 0 [expbar_disp_inside] => 1 [expbar_max_disp] => 1 [expbar_max_level] => 70 [expbar_max_hidden] => 1 [expbar_disp_text] => 1 [expbar_string_before] => [ [expbar_string_after] => ] [expbar_max_string] => Max XP [expbar_loc_x] => 25 [expbar_loc_y] => 73 [expbar_length] => 100 [expbar_height] => 7 [expbar_color_border] => #000000 [expbar_color_bar] => #0B9BFF [expbar_color_inside] => #FFFFFF [expbar_color_maxbar] => #0B9BFF [expbar_trans_border] => 0 [expbar_trans_bar] => 20 [expbar_trans_inside] => 80 [expbar_trans_maxbar] => 0 [expbar_font_name] => VERANDA.TTF [expbar_font_color] => #000000 [expbar_font_size] => 6 [expbar_text_shadow] => [expbar_align] => center [expbar_align_max] => center [skills_disp_primary] => 1 [skills_disp_secondary] => 1 [skills_disp_mount] => 1 [skills_disp_desc] => 1 [skills_disp_level] => 1 [skills_disp_levelmax] => 0 [skills_desc_loc_x] => 285 [skills_desc_loc_y] => 12 [skills_level_loc_x] => 393 [skills_level_loc_y] => 12 [skills_desc_length] => 14 [skills_desc_length_mount] => 22 [skills_align_desc] => left [skills_align_level] => right [skills_desc_linespace] => 8 [skills_level_linespace] => 8 [skills_gap] => 2 [skills_shadow] => #000000 [skills_font_name] => VERANDA.TTF [skills_font_color] => #FF9900 [skills_font_size] => 7 [text_name_disp] => 1 [text_name_loc_x] => 204 [text_name_loc_y] => 42 [text_name_align] => center [text_name_shadow] => #000000 [text_name_font_name] => GREY.TTF [text_name_font_color] => #0066FF [text_name_font_size] => 22 [text_honor_disp] => 0 [text_honor_loc_x] => 126 [text_honor_loc_y] => 68 [text_honor_align] => right [text_honor_shadow] => #000000 [text_honor_font_name] => GREY.TTF [text_honor_font_color] => #99FF33 [text_honor_font_size] => 8 [text_class_disp] => 1 [text_class_loc_x] => 124 [text_class_loc_y] => 38 [text_class_align] => right [text_class_shadow] => #000000 [text_class_font_name] => GREY.TTF [text_class_font_color] => #99FF33 [text_class_font_size] => 8 [text_guildname_disp] => 1 [text_guildname_loc_x] => 204 [text_guildname_loc_y] => 67 [text_guildname_align] => center [text_guildname_shadow] => #000000 [text_guildname_font_name] => GREY.TTF [text_guildname_font_color] => #FFFF66 [text_guildname_font_size] => 16 [text_guildtitle_disp] => 1 [text_guildtitle_loc_x] => 128 [text_guildtitle_loc_y] => 18 [text_guildtitle_align] => left [text_guildtitle_shadow] => #000000 [text_guildtitle_font_name] => GREY.TTF [text_guildtitle_font_color] => #FF9900 [text_guildtitle_font_size] => 9 [text_servername_disp] => 1 [text_servername_loc_x] => 204 [text_servername_loc_y] => 79 [text_servername_align] => center [text_servername_shadow] => #000000 [text_servername_font_name] => GREY.TTF [text_servername_font_color] => #99FF33 [text_servername_font_size] => 9 [text_sitename_disp] => 1 [text_sitename_remove] => 1 [text_sitename_loc_x] => 394 [text_sitename_loc_y] => 79 [text_sitename_align] => right [text_sitename_shadow] => #000000 [text_sitename_font_name] => VERANDA.TTF [text_sitename_font_color] => #FFFF66 [text_sitename_font_size] => 6 [text_spec_disp] => 1 [text_spec_loc_x] => 124 [text_spec_loc_y] => 48 [text_spec_align] => right [text_spec_shadow] => #000000 [text_spec_font_name] => GREY.TTF [text_spec_font_color] => #FF6600 [text_spec_font_size] => 8 [text_talpoints_disp] => 1 [text_talpoints_loc_x] => 124 [text_talpoints_loc_y] => 58 [text_talpoints_align] => right [text_talpoints_shadow] => #000000 [text_talpoints_font_name] => GREY.TTF [text_talpoints_font_color] => #CCFF33 [text_talpoints_font_size] => 7 [text_custom_disp] => 0 [text_custom_loc_x] => 394 [text_custom_loc_y] => 70 [text_custom_text] => Custom Text [text_custom_align] => right [text_custom_shadow] => #000000 [text_custom_font_name] => VERANDA.TTF [text_custom_font_color] => #FFFFFF [text_custom_font_size] => 10 )
* admin\addon_conf.php
o Line: 62
o Function Called: include_once
o Arguments:
+ C:\Web Site Content HTTP Root\VoyseyS\PublicWoW\addons\siggen\admin\index.php
* pages\rostercp.php
o Line: 118
o Function Called: require_once
o Arguments:
+ C:\Web Site Content HTTP Root\VoyseyS\PublicWoW\admin\addon_conf.php
* index.php
o Line: 83
o Function Called: require
o Arguments:
+ C:\Web Site Content HTTP Root\VoyseyS\PublicWoW\pages\rostercp.php



lib\roster.php
439 0.0012 SELECT * FROM `roster_addon` ORDER BY `basename`;
356 0.0012 SELECT guild.* FROM `roster_guild` guild WHERE `guild_id` = "2";
lib\login.php
70 0.0012 SELECT * FROM `roster_account` ORDER BY `account_id` DESC;
lib\functions.lib.php
1083 0.0012 SELECT `config_name`, `config_value` FROM `roster_addon_config` WHERE `addon_id` = '14' ORDER BY `id` ASC;
addons\siggen\inc\functions.inc
415 0.0031 SELECT * FROM `roster_addons_siggen_config` WHERE `config_id` = 'signature';
lib\menu.php
414 0.0016 SELECT count(`member_id`) AS `amount`, IF(`note` LIKE '%alt%',1,0) AS 'isalt', FLOOR(`level`/10) AS label FROM `roster_members` WHERE `level` >= 30 GROUP BY isalt, label;
608 0.0016 SELECT `mb`.*, `a`.`basename` FROM `roster_menu_button` AS mb LEFT JOIN `roster_addon` AS a ON `mb`.`addon_id` = `a`.`addon_id` WHERE `a`.`addon_id` IS NULL OR `a`.`active` = 1;
625 0.0012 SELECT * FROM `roster_menu` WHERE `section` IN ('util','realm','guild') ORDER BY `config_id`;
addons\memberslist\inc\search.inc.php
43 0.0021 SELECT `member_id`, `name` FROM `roster_members` ORDER BY `name`;
addons\questlist\inc\search.inc.php
43 0.0015 SELECT DISTINCT `quest_level` FROM `roster_quests` ORDER BY `quest_level` DESC;
44 0.0012 SELECT DISTINCT `zone` FROM `roster_quests` ORDER BY `zone`;
45 0.0014 SELECT `quest_name` FROM `roster_quests` ORDER BY `quest_name`;
User avatar
shaun.voysey
WR.net Apprentice
WR.net Apprentice
 
Posts: 70
Joined: Thu Aug 10, 2006 12:50 pm
Location: Berkshire, England

Re: [0.3.0_328] Clear_dir truncation

Postby shaun.voysey » Sat Jan 05, 2008 1:34 am

Have discovered the Problem. It stems from the DB Structure and this section of the functions.inc.

Code: Select all
   function processData( $post , $config_name, $data )
   {

..
..
..


         // Fix directories
         if( substr($settingName, -4, 4) == '_dir' )
         {
            // Replace slashes
            $settingValue = str_replace( '\\\\','/',$settingValue );
            $settingValue = str_replace( '\\','/',$settingValue );

            // Check for directories defined with no '/' at the end
            // and with a '/' at the beginning
            if( substr($settingValue, -1, 1) != '/' )
            {
               $settingValue .= '/';
            }
            if( substr($settingValue, 0, 1) == '/' && $settingName != 'save_images_dir' )
            {
               $settingValue = substr($settingValue, 1);
            }
         }

         if( $settingName != 'sc_op' && $settingValue != $configData[$settingName] )
         {
            $sqlarray += array($settingName => $settingValue);
         }
      }


Because the Database has a tinyint(1) for 'clear_dir', this section of code is adding a '/' to the end of it and then trying to upgrade the database.

Current workaround, go through all Siggen code replacing 'clear_dir' with 'cleardir'. Do not forget to change the Database structure with phpmyadmin, as well. Or delete the Siggen config table and recreate after the code changes.
Last edited by shaun.voysey on Sat Jan 05, 2008 1:35 am, edited 1 time in total.
User avatar
shaun.voysey
WR.net Apprentice
WR.net Apprentice
 
Posts: 70
Joined: Thu Aug 10, 2006 12:50 pm
Location: Berkshire, England

[0.3.0_328] Clear_dir truncation

Postby zanix » Sat Jan 05, 2008 3:10 am

Ah, my pathetic attempt at form validation

Thanks for looking into this
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: [0.3.0_328] Clear_dir truncation

Postby shaun.voysey » Sat Jan 05, 2008 3:32 am

zanix wrote:Thanks for looking into this


No problem. Had a little time on my hands and I was a little frustrated that I could not get my avatars, so I'd thought I'd look into it.

At least the detective work has been done. :wink:
User avatar
shaun.voysey
WR.net Apprentice
WR.net Apprentice
 
Posts: 70
Joined: Thu Aug 10, 2006 12:50 pm
Location: Berkshire, England


Return to SigGen

Who is online

Users browsing this forum: No registered users and 1 guest

cron