Author Topic: Extension controller bug  (Read 8498 times)

Offline natdroid

  • Full Member
  • ***
  • Posts: 113
  • Karma: +36/-3
    • View Profile
Extension controller bug
« on: July 04, 2014, 12:47:19 AM »
in install.php we have 
Code: [Select]
$rm->setType('fonts');
$this->db->query("INSERT INTO ".DB_PREFIX."resource_types (`type_id`, `type_name`, `default_directory`, `default_icon`, `file_types`) VALUES ('10', 'fonts', 'fonts/', 'icon_resource_font.png', '/.+(ttf)$/i');");


in config.xml we have Setting upload font
Code: [Select]
        <item id="text_font">
            <type>resource</type>
            <resource_type>fonts</resource_type>
        </item>

when we try to upload new font image setting show  and offcouse  Filetype not allowed error   >:(

https://www.anonimg.com/img/6318cf615ee29fb1065185354899055f.jpg

HELPPP Final Step to a Great Addon

PS
caching  disabled


UPDATE
Bug Report

file admin/controller/pages/extension/extensions.php line 397
Quote
   array('type' => 'image',

Script HARDCODED  :-X

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Extension controller bug
« Reply #1 on: July 08, 2014, 04:32:40 AM »
you have restriction by filetype inside your database. table resource_types. see the mask? column file_types
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline natdroid

  • Full Member
  • ***
  • Posts: 113
  • Karma: +36/-3
    • View Profile
Re: Extension controller bug
« Reply #2 on: July 08, 2014, 01:30:22 PM »
table got updated. Type fonts added. read the post above and I'm sure you'll understand
in install.php we have 
Code: [Select]
$rm->setType('fonts');
$this->db->query("INSERT INTO ".DB_PREFIX."resource_types (`type_id`, `type_name`, `default_directory`, `default_icon`, `file_types`) VALUES ('10', 'fonts', 'fonts/', 'icon_resource_font.png', '/.+(ttf)$/i');");

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2046
  • Karma: +318/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Extension controller bug
« Reply #3 on: July 08, 2014, 02:50:48 PM »
oh.. you found bug in a core
public_html/admin/controller/pages/extension/extensions.php line 408

there hardcode of type
Quote
array('type' => 'image',

as solution i can propose to you use custom setting tpl (look into default_pp_pro config.xml)

Code: [Select]
<custom_settings_template>pages/extension/default_pp_pro_settings.tpl</custom_settings_template>inside your own tpl you can set all html-elements what you want including RL
p.s. do not forget to add this tpl into main.php
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

Powered by SMFPacks Social Login Mod