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

Smart Search PHP Notice when saving filter #10192

Merged
merged 1 commit into from
May 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions administrator/components/com_finder/tables/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,19 @@ public function check()
$this->alias = JFactory::getDate()->format('Y-m-d-H-i-s');
}

// Check the end date is not earlier than start up.
if ($this->d2 > $this->_db->getNullDate() && $this->d2 < $this->d1)
$params = new Registry($this->params);

$nullDate = $this->_db->getNullDate();
$d1 = $params->get('d1', $nullDate);
$d2 = $params->get('d2', $nullDate);

// Check the end date is not earlier than the start date.
if ($d2 > $nullDate && $d2 < $d1)
{
// Swap the dates.
$temp = $this->d1;
$this->d1 = $this->d2;
$this->d2 = $temp;
$params->set('d1', $d2);
$params->set('d2', $d1);
$this->params = (string) $params;
}

return true;
Expand Down