Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache fixes #171

Merged
merged 2 commits into from Mar 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 15 additions & 7 deletions components/com_cck/controller.php
Expand Up @@ -31,7 +31,21 @@ public function __construct( $config = array() )
// display
public function display( $cachable = false, $urlparams = false )
{
parent::display( true );
$cachable = true;

$vName = $this->input->getCmd('view', 'form');

// disable caching on forms and in search&list where search is performed
if ($vName == "form" || $this->input->getMethod() == 'POST' || ($this->input->getCmd('cck', null) && $this->task == 'search'))
{
$cachable = false;
}

$safeurlparams = array('catid' => 'INT', 'task' => 'CMD', 'type' => 'STRING', 'search' => 'STRING',
'boxchecked' => 'INT', 'lang' => 'CMD', 'Itemid' => 'INT');

parent::display($cachable, $safeurlparams);

}

// ajax
Expand Down Expand Up @@ -524,12 +538,6 @@ public function save( $isAjax = false )
$this->setRedirect( htmlspecialchars_decode( $link ) );
}
}

// search
public function search()
{
parent::display( true );
}

// saveOrderAjax
public function saveOrderAjax()
Expand Down