Skip to content

Instantly share code, notes, and snippets.

@croxton
Forked from electricputty/gist:2412497
Created April 18, 2012 12:15
Show Gist options
  • Save croxton/2413194 to your computer and use it in GitHub Desktop.
Save croxton/2413194 to your computer and use it in GitHub Desktop.
blank stash
Sometimes this value is blank
{exp:stash:get_list name='result_data'}{if '{cf_catentry_date}' != ''}{cf_catentry_date}{/if}{/exp:stash:get_list}
// find in mod.stash.php:
if ( $this->not_empty($matches[1]) || $matches[1] === '0')
{
$stash_vars[substr($key, 6)] = preg_replace('/'.LD.'stash:[a-zA-Z0-9\-_]+'.RD.'(.*)'.LD.'\/stash:[a-zA-Z0-9\-_]+'.RD.'/Usi', '', $matches[1]);
}
// replace with:
if ( $this->not_empty($matches[1]) || $matches[1] === '0')
{
$stash_vars[substr($key, 6)] = preg_replace('/'.LD.'stash:[a-zA-Z0-9\-_]+'.RD.'(.*)'.LD.'\/stash:[a-zA-Z0-9\-_]+'.RD.'/Usi', '', $matches[1]);
}
else
{
$stash_vars[substr($key, 6)] = '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment