Git Product home page Git Product logo

mustash's Introduction

Mustash 3.0.1

Mustash for ExpressionEngine.

Description

Mustash is an ExpressionEngine control panel module for managing cached Stash variables, bundles and cache-breaking rules.

Key features

  • Search, filter, edit and delete cached Stash variables and static file caches
  • Flush cache globally, by scope or by bundle
  • Create and edit your own bundles
  • Setup advanced cache-breaking rules for core modules and third-party add-ons
  • Extensible plugin architecture
  • Web API with custom hooks
  • Configurable access permissions

Installation

  1. Install and configure Stash (version 3.1.0 or later is recommended)
  2. Upload the system/user/addons/mustash folder to ./system/user/addons/
  3. In the CP, navigate to the Add-on Manager and click the 'Install' link for the Mustash module

Copyright (c) 2021 Hallmark Design https://hallmark-design.co.uk

mustash's People

Contributors

croxton avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

acerorg

mustash's Issues

EE6

Hi,

I installed the EE6 version to test it out and noticed that when I try to go to the settings panel, the following exception is thrown:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cpsca_7.exp_member_groups' doesn't exist:
SELECT group_id, group_title FROM (exp_member_groups) WHERE group_id NOT IN (1, 2, 3, 4) ORDER BY group_title asc

Apart form that, the only other issue I see is a mis-aligned search input field on the variables page.

When do you think this will be officially released? i have several sites that use the add-on.

Rob

RewriteCond

While this isn't a Mustache problem directly I have run into a tricky issue that I thought it was worth checking if you have run into. Running Apache we are using the standard rewrite conditions and rules recommended for Mustash. Unfortunately the REQUEST_METHOD rule is being ignored so in the admin with certain third party addons we are getting a cached homepage returned. Have you had anyone report anything similar or have any thoughts? Thanks!

A quick note on Bundles, and a question

I am a regular Stash user but I confess never have used bundles before. They are a really powerful tool in the context of Mustash, though. Here is what I discovered about them, maybe Mark can expand on that a little bit?

If you use bundle="news" in a setter, you also have to use it in the corresponding getter. It behaves like the scope and context parameters. For example:

{!-- Stash News List --}
{exp:stash:set_list name="st_news" bundle="news" parse_tags="yes" save="yes" replace="no" refresh="60" scope="site" context="@URI"}
    {exp:channel:entries disable="pagination|categories|category_fields|member_data|trackbacks" channel="news" status="open" orderby="date" sort="desc" limit="5"}
        {stash:st_title}{title}{/stash:st_title}
        {stash:st_url}{url_title_path="news_press/news"}{/stash:st_url}
    {/exp:channel:entries}
{/exp:stash:set_list}

and

{!-- Display News List (be sure to use bundle, context and scope parameters matching the set_list tag) --}
{exp:stash:get_list name="st_news" bundle="news" prefix="stashprefix" scope="site" context="@URI"}

    {if count == "1"}<ul>{/if}
        <li class="group">
            <h2><a href="{st_url}">{st_title}</a></h2>
        </li>
    {if count == total_results}</ul>{/if}

    {!-- if no results --}
    {if stashprefix:no_results}<p>No News Found</p>{/if}
{/exp:stash:get_list}

The Stash doc states that bundles are created automatically whenever you create use one in a set tag of any kind. For me such bundles never appeared in the Mustash CP and those variables were stored as belonging to the default bundle in the DB. When I created the bundle manually in the CP, everything works as expected.

Am I missing something (as I usually am)?

Using Mustash 1.0.2 / Stash 2.3.9 / EE 2.5.5

Small case sensitivity problem when editing bundles

Looks like when editing a bundle, the test done to see if a bundle already exists is not case sensitive.

I created a bundle with the name of "Offices" and wanted to change it to "office" (with a lowercase "O"). Message saying "that bundle name already exists". Could not change it in the CP, had to go through DB. In the DB, the name was registered with a capital "O" and I could change it to a lowercase "o". So my guess is that it is the test that is not case sensitive.

Missing Hooks + Plugins PHP Error

Mark, the addon is looking awesome, thanks so much. Will be a huge help for us. A couple things I ran into this morning while paying around. Both of these are with EE 2.6.1 and stash 2.3.9.

Under cache breaking rules there are no hooks in the dropdown by default. I would assume there would be a few standard ones like publish, edit, delete, etc? Just shows --Please Select-- and that's it.

From the settings page in the plugins section I get the following output in the right column:

$name):; ?>
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: plugin

Filename: core/Loader.php(727) : eval()'d code

Line Number: 98

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: name

Filename: core/Loader.php(727) : eval()'d code

Line Number: 100

Mustash is making a call to `exp_member_groups` database table, which is non-existent in ExpressionEngine 6

Got this exception in EE 6.4.3:

Mustash is making a call to exp_member_groups database table, which is non-existent in ExpressionEngine 6. If you are site owner, try upgrading Mustash to latest available version. If you are the add-on developer, update your Stash_member_model_pi class to use Role model.

ee/legacy/database/DB_active_rec.php:1705
Stack Trace: Please include when reporting this error

#0 system\ee\legacy\database\DB_active_rec.php(263): CI_DB_active_record->_track_aliases('member_groups')
#1 system\user\addons\mustash\plugins\stash_member_model_pi.php(201): CI_DB_active_record->from('member_groups')
#2 system\user\addons\mustash\plugins\stash_member_model_pi.php(160): Stash_member_model_pi->_get_member_group_title(1)
#3 system\user\addons\mustash\plugins\stash_member_model_pi.php(119): Stash_member_model_pi->_prep_markers(Array)
#4 [internal function]: Stash_member_model_pi->after_member_update(Object(ExpressionEngine\Model\Member\Member), Array, Array)
#5 system\user\addons\mustash\ext.mustash.php(111): ReflectionMethod->invokeArgs(Object(Stash_member_model_pi), Array)
#6 system\ee\legacy\libraries\Extensions.php(203): Mustash_ext->__call('member_model:af...', Array)
#7 system\ee\legacy\libraries\Extensions.php(108): EE_Extensions->call_class('Mustash_ext', 'after_member_up...', Array, Array)
#8 [internal function]: EE_Extensions->call('after_member_up...', Object(ExpressionEngine\Model\Member\Member), Array, Array)
#9 system\ee\ExpressionEngine\Service\Model\Model.php(664): call_user_func_array(Array, Array)
#10 [internal function]: ExpressionEngine\Service\Model\Model->ExpressionEngine\Service\Model\{closure}('after_member_up...', Object(ExpressionEngine\Model\Member\Member), Array, Array)
#11 system\ee\ExpressionEngine\Service\Model\Model.php(610): call_user_func_array(Object(Closure), Array)
#12 [internal function]: ExpressionEngine\Service\Model\Model->ExpressionEngine\Service\Model\{closure}(Array)
#13 system\ee\ExpressionEngine\Service\Event\Emitter.php(132): call_user_func_array(Object(Closure), Array)
#14 [internal function]: ExpressionEngine\Service\Event\Emitter->emit('afterUpdate', Array)
#15 system\ee\ExpressionEngine\Library\Data\Entity.php(637): call_user_func_array(Array, Array)
#16 [internal function]: ExpressionEngine\Library\Data\Entity->emit('afterUpdate', Array)
#17 system\ee\ExpressionEngine\Service\Model\Model.php(843): call_user_func_array('parent::emit', Array)
#18 system\ee\ExpressionEngine\Service\Model\Query\Update.php(50): ExpressionEngine\Service\Model\Model->emit('afterUpdate', Array)
#19 system\ee\ExpressionEngine\Service\Model\DataStore.php(275): ExpressionEngine\Service\Model\Query\Update->run()
#20 system\ee\ExpressionEngine\Service\Model\DataStore.php(240): ExpressionEngine\Service\Model\DataStore->runQuery('Update', Object(ExpressionEngine\Service\Model\Query\Builder))
#21 system\ee\ExpressionEngine\Service\Model\Query\Builder.php(71): ExpressionEngine\Service\Model\DataStore->updateQuery(Object(ExpressionEngine\Service\Model\Query\Builder))
#22 system\ee\ExpressionEngine\Service\Model\Model.php(370): ExpressionEngine\Service\Model\Query\Builder->update()
#23 system\ee\ExpressionEngine\Model\Content\ContentModel.php(219): ExpressionEngine\Service\Model\Model->save()
#24 system\ee\ExpressionEngine\Controller\Members\Profile\Auth.php(75): ExpressionEngine\Model\Content\ContentModel->save()
#25 [internal function]: ExpressionEngine\Controller\Members\Profile\Auth->index()
#26 system\ee\ExpressionEngine\Core\Core.php(266): call_user_func_array(Array, Array)
#27 system\ee\ExpressionEngine\Core\Core.php(122): ExpressionEngine\Core\Core->runController(Array)
#28 system\ee\ExpressionEngine\Boot\boot.php(161): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#29 admin.php(144): require_once('C:\\intranet_ee\\...')
#29 admin.php(144): require_once('C:\\intranet_ee\\...')

{site_url} empty in cache

We are running into a pretty major issue where one of our client's homepage is occasionally caching with a blank site_url instead of the actual URL which breaks all the nav links. Clearing the page cache resolved the problem as the new cache is correct but it has happened multiple times after cache breaking rules have cleared it. I've only seen it on the homepage so far but that may be coincidence. I am almost certain it has to be Stash/Mustash related. Any ideas on this one? Thanks.

List expired variables?

I put {exp:stash:unset name="foo"} at the end of a template, but in the CP > Stash variables the variable was still listed with an expiry date in the past. Like:
183760 foo Aug 07, 2013, 01:12:41 Aug 08, 2013, 01:12:41 Default User

UI first impression

Hey Mark,

Looking good so far. No time yet for extensive testing but I will get to it.

My first suggestion would be UI-related. After first installing the module, I naturally went to the module page and was a bit baffled by only seeing "stash variables" and "clear variables". It took me while to notice that a new menu item has appeared and that the "bundles" and "rules" were available in there.

Would you consider duplicating all the items in that menu as buttons ?

PHP error thrown when using multi edit form: call to undefined method

When using the multi entries edit form and having cache breaking rules set using the update_multi_entries_loop hook, a PHP error gets thrown at me after submitting the multi entries edit form in the CP:

Fatal error: Call to undefined method Stash_channel_entries_pi::_get_channel() in /data/weblocal/polarfoundationv4/assets/addons/system/mustash/plugins/stash_channel_entries_pi.php on line 167

Add "tags" feature for arbitrary cache targetting

Originally from:
https://devot-ee.com/add-ons/support/stash/viewthread/12576/P15

Another big advantage CE Cache’s “tag” approach has is being able to bubble tags up to the parent.
Consider a setup where you are refreshing things based on entry_id. Tags could then hypothetically be set up like this:

{exp:stash:set_list
  name="sections"
  tags="{structure:page:entry_id}"
}
  {some_relationship_field}
    {stash:content}{title} - {cf_body}{/stash:content}
    {exp:stash:add_tags name="sections"}{entry_id}{/exp:stash:add_tag}
  {/some_relationship_field}
{/exp:stash:set_list}

That was this list would be cleared if the page that it is on is updated, OR any of the entries in the list.
Again, very similar to tags in CE Cache: http://www.causingeffect.com/software/expressionengine/ce-cache/user-guide/tags

Cant find stash_member_model_pi.php

I'm getting this error after upgrading EE5 to EE6 and Mustash to latest (php7.4).

Warning
require_once(user/addons/mustash/plugins/stash_member_model_pi.php): failed to open stream: No such file or directory
user/addons/mustash/libraries/Mustash_lib.php, line 93
Severity: E_WARNING

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.