I am trying to set a system with a custom plugin via a variable passed through the URL.
I have done this successfully BUT I also need to clear the cache when this fires otherwise I get the cached setting when I use the placeholder [[++theme_name]] and that is where I am running into trouble...
Currently running MODX 2.3.0.
Here is my plugin code: (fires OnWebPageInit)
<?php
$theme = isset($_GET['theme']) ? $_GET['theme'] : '' ;
$clearss = array( 'system_settings' => array() );
$modx->cacheManager-> refresh($clearss);
$Setting = $modx->getObject('modSystemSetting', 'theme_name');
$Setting->set('value', $theme);
$Setting->save();
This changes my system setting properly.
Here is a link to the page and how I am passing the variable :
http://modx.immarketing.net/?theme=theme1
Any advice as to how I can get my system_settings cache to clear? It would be great if I could just clear that one setting.