Drupal 7 caching my form and printing old cached fields (Varnish/Memcache) - caching

I have a profile2 form called by drupal_get_form - though after its been edited and saved, the fields still display the old information for awhile. How can I turn caching off here? I'm using memcache/varnish/apc btw.
I'm also printing these fields elsewhere and get the same problem.. I would rather this be dynamic and fresh for just these fields/forms.. any ideas on how to do that? Thanks!

Probably you need to exclude cache_form from memcache with:
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
in your settings.php file

Related

Bitrix CMS, how to get cached data based on GET parameter in template of standart component?

I'm working with a component bitrix:catalog (which is standard one) and faced an issue. I want to add some extra GET parameters to switch view mode. I think there is no need to rewrite whole component to make such switcher, so I added extra keys in result_modifier in a way similar to:
$this->__component->arResultCacheKeys = array_merge($this->__component->arResultCacheKeys, array('key1', "key2"));
Earlier in the same result_modifier I perform adding those extra keys in $arResult['key1'] etc. They seem to be correctly saved, but only for current inquiry such as ?view=list or view=card, that means only one variable value is saved and it does not react on changing of GET parameter. Is there simple and correct way to make that component to cache and to output data based on GET variable? The only idea which came to my mind is to rewrite component by adding extra parameter and checking of GET, but I think there must more simple and correct solution to make in via template. Human Readable Links are turned on. And I want to have auto-cash being turned on as well. If I turn it off it starts working as planned.
One of possible solutions is to rewrite it cache by SetTemplateCachedData but it still seems to me rough and incorrect way for such simple task.
Bitrix masters please help me to find correct solution, google can't help at the moment.
If you use standard bitrix:catalog component, you may be use standart bitrix:catalog.section. In that component.php used standart component cache.
That means you can describe additional parametr in you custom .parameters.php, and set it in bitrix:catalog.section params.
Standart component cache set cacheId based on arParams.
So you include component should look like this:
$APPLICATION->IncludeComponent(
"bitrix:catalog.section",
"",
array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"ELEMENT_SORT_FIELD" => $arParams["ELEMENT_SORT_FIELD"],
"ELEMENT_SORT_ORDER" => $arParams["ELEMENT_SORT_ORDER"],
....
....
"NEW_ADDITIONAL_GET_PARAMS"=> $_GET['view']
),
$component
);
Of course better way somethink like
"NEW_ADDITIONAL_GET_PARAMS"=> (in_array($_GET['view'],array('list','card'))?$_GET['view']:'list')
But may be you need just set right catalog params: SEF_MODE SEF_FOLDER SEF_URL_TEMPLATES

typo3 cache_pages table have huge size

I use Typo3 version 4.5.19 - I have a huge problem with cache_pages table - for page id=1 i have hundreds of records and database size grow higher then 500 M in less then 24 hours.
On this page I have plugin tt_news installed . I also have other different TYPO3 installation with tt_news and for them I don't have this problem . I can't figure out which is the problem.
Have any thoghts what should I do?
Probably you have various GET params that create different cache entries for each view of the same page. If you google for "typo3 cache_pages huge" you will get quite a few results, e.g. someone had a calendar plugin and it generated a page cache copy for each view of the calendar.
There are two caching mechanisms in TYPO3 < 4.6, the newer of which is called caching framework. I'm not sure which you're running on, and how it should help, but it seems related.
Also check your cHash settings; this article might be helpful: http://www.typo3-media.com/blog/chash-caching-typo3.html
I don't think your news plugin is the problem, since this would rather affect the cache_hash table.
A possible problem could be conditions in your TypoScript. If you do a condition like [globalVar = GP:L = 1], note that this will create an additional cache entry in cache_pages. You can see all your conditions at once in the TypoScript object browser.

Smart Search Joomla One Result

I just enabled the Smart Search plug-in, and everything were great!
I just wanted to know when the query have ONE result, I'd love Joomla! will direct the user to this page directly.:(
Anyone has this issue and solved it ?
In this file components\com_finder\views\search\view.html.php add the below line inside display function. After this line - $this->assignRef('pagination', $pagination);
if(count($results)==1){
$app->redirect($results[0]->path);
}
This is a core file change so please do if necessary.
let me know if it does not work.

Google Analytics not tracking conversions in Magento 1.7

I'm using Magento's built in Googleanalytics module which is working fine for page views, but not for conversions. The account is set up fine on Google, but it's not adding the addTrans part in the checkout/onepage/success page.
I've done a lot of digging this morning, and found that the observer does observe the "checkout_onepage_controller_success_action" correctly, and does indeed run. It does the following:
$block = Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('google_analytics');
if ($block) {
$block->setOrderIds($orderIds);
}
I've done some echoing, and it does retrieve the block, and it also sets the order ids correctly. However, in the block itself, if I echo out $this->getOrderIds(); its empty.
My next thought was that perhaps it could be using two GA blocks on the page, and maybe its passing the data to the first one but echoing the HTML of the 2nd one, but I've no clue how to start checking that! The Googleanalytics.xml file only has one block it in, and I don't use that block name anywhere else!
Anyone experienced similar? Or have any idea where I can go from here?
EDIT:
The Ga.php block includes the transaction code if $this->getOrderIds() returns an array, which it is not doing. However, the observer is doing $block->setOrderIds($order_ids); which is passing through an array containing an order id. So the observer is passing the ids to the block, and the block is receiving them (setting up a method of setBlockIds and echoing out the argument, does show the array), but when the block tries to access its own data, it's suddenly not there ($block->getData() returns an array of properties but there is no order_ids property).
I also figured maybe it could be that its echoing the blocks HTML before setting the order id, so I added some variables in to check that and it's not that - its definitely setting the order_ids before trying to get them again, but its still not working!
I'm completely stumped! My only idea now is to modify the Ga.php block to use Magento's registry instead of it's own _data property, which is really not a nice way of doing it!
I think i've been an utter tool. Magento wasn't tracking conversions on the live site because I hadn't put the account code in the configuration part, but I had on my test site.
I had previously put my own analytics code in the template, so I had tracked page views.
When I saw no conversions (despite putting the account code in my test site), I started making orders on the test site and then viewing the source of the order success page. Firefox loads its source as a new request...which automatically goes to the empty basket page. So obviously, it wasn't showing the addTrans or anything, because it had already done that.
A quick check in firebug revealled it was working as it should.
So in the end, after a day of searching, I had to change "No" to "Yes" in the admin, and type in the account code. Great.

joomla users admin

In the joomla users admin when a users data is loaded, where is the function to call the users data
administrator/components/com_users/models/user.php
$result = parent::getItem($pk);
This is the code that returns the data, but I need to find where this function is? I want to amend the query as I've added some form fields, but I need to know which parent, as there are many getItem functions in Joomla
Thanks in advance
Joomla 1.7 provides a mechanism ( http://docs.joomla.org/Creating_a_profile_plugin ) for adding extra fields through user plugins. This is a far more robust method than editing core files - for one thing edits to core files risk being overwritten as soon as you update and as updating is a simple push button affair it is likely to be sooner rather than later.
found it libraries/joomla/application/component/modeladmin.php

Resources