2

Background
So i keep getting an error when adding more images to the second Content-Elements field on one of my pages.

I have one for the maincontent and this one seems to work with an "infinite" amount of images. The second one, who is also parsed last gives me this error:

Error

Unable to load the requested class: assets_lib

The first field currently has 3 Assets-elements with at total of 28 images.

When i try to add more than 4 images to the same kind of Element in the second field i get the error above?

I am not sure where to go next, is there a way to get more info out of EE's error manager. A file and row # would be a nice start. :P

Is this a problem with Content-Elements or with Assets?

Is there anything i can add to help out?

Versions
- EE: 2.8.1
- Assets: 2.3.1
- Content-Elements: 1.6.9 - Stash: 2.5.1

Template code
I keep the Elements-part in a Stash embed, the part that handles assets is:

{assets}

<div class="row-fluid">
  {files}
  <div class="span3">
    <a href="{url}" class="gallery" rel="{element_name}_{element_id}">
      <img src="{url:150x150}" alt="{alt_text}" title="{title}">
  </a>
</div>
{switch="|||</div><br /><div class='row-fluid'>"}

{/files}
</div>
<br>
{/assets}

the part of the page template that embeds them looks like this:

{exp:stash:content parse="inwards"}

<div class="row-fluid">
  <div class="span7">

    <h1>{title}</h1>
    {page-content}
    {stash:embed:components:content_elements_parser process="start"}
    {/page-content}

  </div>
  <div class="span4 offset1 subtopmargin">

    {page-content-2}
    {stash:embed:components:content_elements_parser process="start"}
    {/page-content-2}

    {page-modules-right}
    ...
    {/page-modules-right}
  </div>

  {stash:embed:components:social_share}
</div>
</div>

{if page-modules-bottom}
<div class="row-fluid content">
  <div class="span12">
    ...
  </div>
  {/if}
  {/exp:stash:content}
1
  • I am having this same error using Content Elements and Assets. I have my CE code in a Low Variables variable. It used to work, then I added some more conditionals for different element names, and now it's broken. Will be watching your question to see what develops.
    – Amy Witty
    Commented May 7, 2014 at 19:57

1 Answer 1

2

Open up ft.assets.php file (located at third_party/assets/ft.assets.php), find the method "replace_element_tag" and add this as the first line in that method:

$this->EE->load->add_package_path(PATH_THIRD.'assets/');

Sometimes EE would lose that package path and I'm not entirely sure why.

3
  • Works like a charm! :) Commented May 27, 2014 at 14:33
  • Andris - I'm getting the same error when attempting to edit an entry with an Assets field in the CP, and I applied your fix with no change. I'm on the latest version of Assets + EE 2.7.3, any thoughts? Commented Jun 2, 2014 at 22:06
  • I had this issue on a custom module when loading up the asset_lib. Added Andris' line above "$this->EE->load->library('assets_lib');" and it worked a treat. Commented Jan 29, 2016 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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