RequireAsset works in application/blocks, not in a package

Permalink
Doing some default requireasset in on_start function like this:

$al = \Concrete\Core\Asset\AssetList::getInstance();
 $al->register(
            'css', 'datetimepicker', 'blocks/datetime_test/css_form/bootstrap-datetimepicker.min.css'
        );


And in the add function this:

$this->requireAsset('css', 'datetimepicker');


As a block being in application/blocks, this works perfect! Except... when I make a package out of this block... it doesn't. What can we do to make this work within a package as well? It's now searching in concrete/blocks instead of packages/the_package_handle/blocks... Can we pass a package handle along, or... should another if/else be build into the core?

Would love to hear your suggestions on this, as I think both should work with the same code ( at least, my opinion :) ).

ramonleenders
 
MrKDilkington replied on at Permalink Best Answer Reply
MrKDilkington
Hi ramonleenders,

This should work if you add the package handle.

$al->register(
    'css', 'datetimepicker', 'blocks/datetime_test/css_form/bootstrap-datetimepicker.min.css', array(), 'package_handle'
);
ramonleenders replied on at Permalink Reply
ramonleenders
Thanks, worked like a charm!