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 May 7 '14 at 19:57
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! :) – Kim Wickell May 27 '14 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? – Jacob Russell Jun 2 '14 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. – Dave O'Brien Jan 29 '16 at 15:24

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.