Concrete looking inside concrete folder for registered block assets

Permalink
Hi all,

After registering my assets in my custom block controller for a block which uses a plugin, I am getting an error saying that it can't find the file because it's looking in:

concrete/filepath/filename.min.js

instead of:

filepath/filename.min.js

It should be looking in application/filepath/filename.min.js seeing as that's where my block is, and I have tried adding 'application' to the filepath but it still just adds 'concrete/application/filepath/filename.min.js'

Any ideas why this might be happening?

Thank you!

 
hutman replied on at Permalink Reply
hutman
Can you please provide some code? Often times this happens because of an incorrect path or namespace in the controller.
BrendanLawton replied on at Permalink Reply
Sure:

<?php
namespace Application\Block\blockname;
defined("C5_EXECUTE") or die("Access Denied.");
use Concrete\Core\Block\BlockController;
use Concrete\Core\Asset\AssetList;
use Concrete\Core\Asset\Asset;
use Core;
use Loader;
class Controller extends BlockController
{
    public $helpers = array (
      0 => 'form',
      );
    public $btFieldsRequired = array (
      0 => 'name',


The lines that I added were the 'use ...Asset' & 'Use ...AssetList' at the top, and the on_start and registerViewAssets functions at the bottom

Thank you!
hutman replied on at Permalink Reply
hutman
On my local environment I set this up with the same stuff and created those directories and it worked perfectly for me. The only time it didn't work is if the path to the asset didn't exactly match the actual path inside the application folder.
BrendanLawton replied on at Permalink Reply
That's really weird then... I have to write ../application to get it to start from the application folder. So yours does that by default anyway?
brianh781 replied on at Permalink Reply
I was having the same problem. Looking in concrete/src/Asset/JavascriptAsset.php on line 33, you'll see that the path is set with the following code:

public static function getRelativeOutputDirectory()
    {
        return REL_DIR_FILES_CACHE.'/'.DIRNAME_JAVASCRIPT;
    }


So, I cleared the cache and made sure all caching was turned off... it fixed the problem.