Extension, Module

Archived
Forum
(read-only)

Stash

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6

Back to this add-on's main page
View Other Add-ons From Mark Croxton

     

“unknown cache type”

Support Request

Sneed's Feed & Seed
Sneed's Feed & Seed

I’m using Stash `append_list` and `get_list` tags to output a set of entries grouped by channel. Below it I have a separate channel entries loop with a simple date checker plugin:

{exp:channel:entries
      channel
='cookies|cakes|pies'
      
dynamic='no'
      
cat_id='375'
      
disable='member_data|pagination|category_fields'
      
sort='asc'
      
status='not closed'
      
parse='inward'
    
}
      {exp
:stash:append_list name='treats' context='{channel_short_name}'}
        {stash
:title}{title}{/stash:title}
      {
/exp:stash:append_list}
    {
/exp:channel:entries}

    
<h3>Study Materials</h3>
    <
ul class="study-materials">
      
{exp:stash:get_list name='treats' context='cookies' process='end' parse_tags='yes' parse_conditionals='yes'}
        {title}
<br>
      
{/exp:stash:get_list}

      {exp
:stash:get_list name='treats' context='cakes' process='end' parse_tags='yes' parse_conditionals='yes'}
        {title}
<br>
      
{/exp:stash:get_list}

      {exp
:stash:get_list name='treats' context='pies' process='end' parse_tags='yes' parse_conditionals='yes'}
        {title}
<br>
      
{/exp:stash:get_list}
    
</ul>

    
{exp:channel:entries
      channel
='purchased_items'
      
limit='1'
      
dynamic='no'
      
disable='pagination|categories'
      
search:purchased_id='{subscription_ids}'
      
author_id='{logged_in_member_id}'
    

      {exp
:entry_age type='older' days_old='365' entry_date='{entry_date}'}
        
<p>Your plan has expired. <a href="{path='features-and-pricing'}">Renew.</a></p>
      
{/exp:entry_age}

      {if no_results}
        
<p>You are on the free plan. <a href="{path='features-and-pricing'}">Purchase a subscription</a></p>
      
{/if}
    {
/exp:channel:entries} 

I get this error when I access the template:

Stash: unknown cache type defined by the type=”” parameter.older

 

Mark Croxton
# 1
Developer
Mark Croxton

Looks like type=‘older’ is a parameter passed to the entry_age tag. I’m not sure how it ends up getting passed to Stash. Normally I’d look for gremlin characters, linespace in parameters or curly quotes or unclosed tags as the cause - but I can;t see any problem here. So it could be something the plugin is doing or a bug. You could try to set the type explicitly when getting your lists:

{exp:stash:get_list name='treats' context='cookies' process='end' type='variable'}
        {title}
<br>
{/exp:stash:get_list} 

Does that work?

Sneed's Feed & Seed
# 2
Sneed's Feed & Seed

Nope, that didn’t work.

Sneed's Feed & Seed
# 3
Sneed's Feed & Seed

A little more info:

Removing the “process=‘end’” parameter from the :get_list tag fixes the error, but then I don’t get any output from Stash.

Mark Croxton
# 4
Developer
Mark Croxton

Did you add type=‘variable’ to every get_list?

Sneed's Feed & Seed
# 5
Sneed's Feed & Seed

Yes.

Mark Croxton
# 6
Developer
Mark Croxton

Are you using the latest version of Stash and do you have the Stash extension installed? Is there any chance I could see the code of the {exp:entry_age} plugin?

Sneed's Feed & Seed
# 7
Sneed's Feed & Seed

I’m using Stash 2.3.9 and yes, the extension is installed.

What’s your email address so I can send you the plugin file?

Mark Croxton
# 8
Developer
Mark Croxton

mcroxton AT hallmark-design.co.uk

Sneed's Feed & Seed
# 9
Sneed's Feed & Seed

email sent.

Mark Croxton
# 10
Developer
Mark Croxton

Thanks got it.

That entry_age add-on shouldn’t be returning anything from the constructor:

// Return
return $this->return_data

Could be that’s throwing an error. You should delete that bit, the plugin will still work.

Also please upgrade to the latest version of Stash (2.4.2).
https://github.com/croxton/Stash

Let me know if that helps, if not I’ll do some testing.

Sneed's Feed & Seed
# 11
Sneed's Feed & Seed

I commented out that line from the entry age plugin (line 85, right?), and updated to Stash 2.4.2 (made sure to run module updates), but I’m still getting the error :/

Mark Croxton
# 12
Developer
Mark Croxton

It’s a weird one alright. I’ll do some testing tomorrow and let you know if I can work out what is happening.

Mark Croxton
# 13
Developer
Mark Croxton

This turned out to be a bug. The params passed to the last tag in a template were getting persisted into the post-parsed tags. Fixed in 2.4.3:
https://github.com/croxton/Stash

Sneed's Feed & Seed
# 14
Sneed's Feed & Seed

Hooray! Thanks Mark.