Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Custom Block Content Rate Topic   - - - - -

 
  • dataspotgr
  • Advanced Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 52 posts

Posted 23 February 2021 - 01:20 PM #1

Hi, i'm building a Custom Block and i could use some help on a problem that i have.

 

The block is working fine, but when i'm trying to add the "Content" tab on the block's settings it's not working. 

Actually, i want to be able to select some categories, and besad on the selected categories to do something in the front-end.

 

So, in order to select the categories i used this code:

$schema['ds_categories_scroller'] = array (
    'templates' => 'addons/ds_categories_scroller/blocks/ds_categories_scroller.tpl',
    'wrappers' => 'blocks/wrappers',
    'cache' => false,
    'content' => array(
        'items' => array(
            'type' => 'enum',
            'object' => 'categories',
            'items_function' => 'fn_get_categories',
            'remove_indent' => true,
            'hide_label' => true,
            'fillings' => array(
                'manually' => array(
                    'params' => array(
                        'plain' => true,
                        'simple' => false,
                        'group_by_level' => false,
                    ),
                    'picker' => 'pickers/categories/picker.tpl',
                    'picker_params' => array(
                        'multiple' => true,
                        'use_keys' => 'N',
                        'status' => 'A',
                        'positions' => true,
                    ),
                ),
            ),
        ),
    )
);

return $schema;

The problem now is that when i try to open the block's setting i got this cs-cart error:

"ErrorOops, something went wrong (Internal Server Error). Please try again."
 
Also i have those error in my php logs:
[23-Feb-2021 15:15:08 Europe/Athens] PHP Warning:  Illegal string offset 'items' in /home/designplus/public_html/staging/app/controllers/backend/block_manager.post.php on line 656
[23-Feb-2021 15:15:08 Europe/Athens] PHP Fatal error:  Uncaught Error: Cannot use string offset as an array in /home/designplus/public_html/staging/app/controllers/backend/block_manager.post.php:656
Stack trace:
#0 /home/designplus/public_html/staging/app/functions/fn.control.php(679): include()
#1 /home/designplus/public_html/staging/app/functions/fn.control.php(430): fn_run_controller('/home/designplu...', 'block_manager', 'update_block', '', '')
#2 /home/designplus/public_html/staging/instore.php(27): fn_dispatch()
#3 {main}
  thrown in /home/designplus/public_html/staging/app/controllers/backend/block_manager.post.php on line 656
[23-Feb-2021 15:15:08 Europe/Athens] PHP Fatal error:  ob_get_clean(): Cannot use output buffering in output buffering display handlers in /home/designplus/public_html/staging/app/Tygh/Ajax.php on line 139

I think there must be something with the 'type' => 'enum', because i tryied to change this for test perpuses with 'type' => 'text', and the setting opened normaly.

 



 
  • dataspotgr
  • Advanced Member
  • Authorized Reseller
  • Join Date: 04-Sep 13
  • 52 posts

Posted 02 March 2021 - 01:29 PM #2

Problem fixed. I was able to make it work. 

 

Not sure what the problem was, because i just wrote this code all over again and now it works.