0

Since I updated my EE installation from 2.5.5 to 2.6.0 the {exp:assets:files}-tag pair does not output anything anymore. I have also updated Assets to 2.1.1. Also {exp:assets:total_files} returns zero. The {exp:assets:folders}-tag pair works fine. I have also reindexed all files.

My template code looks like this:

<ul class="unstyled">
    {exp:assets:folders parent_folder="{filedir_5}"}
        <li><i class="icon-folder-open"></i> {folder_name}</a>
            {if total_subfolders}
                <ul class="unstyled" style="margin-left: 25px;">
                    {subfolders}
                </ul>
            {/if}
            <ul class="unstyled" style="margin-left: 25px;">
                {exp:assets:files folder_id="{folder_id}"}
                    <li><i class="icon-file"></i> <a href="/{exp:link_vault:download_link file_path='../../../../{server_path}' url_only='true' action_only='true' }">{if title != ""}{title}{if:else}{filename}{/if} ({size})</a></li>
                {/exp:assets:files}
            </ul>
        </li>
    {/exp:assets:folders}
</ul>

I am showing a whole file hierarchy of a file directory above the web root (therefore link-vault-addon usage). The folder are outputted correctly but no files are shown. I have also tried your example usage from the docs:

{exp:assets:folders recursive="yes"}
<h3>{folder_name}</h3>
<ul>
    {exp:assets:files folder_id="{folder_id}"}
        <li><a href="{url:huge}" target="_blank">{if title != ""}{title}{if:else}{filename}{/if}</a></li>
    {/exp:assets:files}
</ul>
{/exp:assets:folders}

But this also only outputs all folders but no files.

Any help is appreciated. Thanks!

4
  • Have you re-indexed at all?
    – Ian
    Apr 28 '13 at 19:29
  • Hey yoursort - on top of re-indexing - please check that /system/expressionengine/cache is set to 777 permissions, and that your file upload directories also are. Can you also post your full template code in your original post? I see the link, but I'd like to see exactly what you are testing with.
    – Lisa
    Apr 29 '13 at 18:35
  • Yes, the permissions are fine. See the template code in the question.
    – Lars Bilke
    May 2 '13 at 9:44
  • Hey yoursort - there is currently a bug with the parent_folder parameter stopping any output. I've submitted that to our devs. I cna also reproduce that the sample code from the docs does not work and have submitted that as a bug.
    – Lisa
    May 2 '13 at 14:50
0

sorry for the long wait - we've isolated the bug and fixed it - the fix will be included in the next release.

For a hot-fix, open the third_party/assets/libraries/assets_lib file, locate the get_files_in_folder method and add this at the very beginning of this method:

if (is_array($file_ids))
{
  $file_ids = array_filter($file_ids);
}

That should fix your thing!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.