Skip to content

Commit

Permalink
v2.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kjmartens committed Nov 28, 2018
1 parent b3dd99c commit 37628c0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Solspace Freeform Changelog

## 2.5.3 - 2018-11-28
### Fixed
- Fixed a bug where the Recent Submissions widget was causing an error in the Craft Dashboard page.
- Fixed a bug where `rand()` and other native SQL functions did not work for `orderBy` parameter in `freeform.submissions`.

## 2.5.2 - 2018-11-27
### Added
- Added Freeform Submissions Element Fieldtype.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "solspace/craft3-freeform",
"description": "The most intuitive and powerful form builder for Craft.",
"version": "2.5.2",
"version": "2.5.3",
"type": "craft-plugin",
"authors": [
{
Expand Down
13 changes: 10 additions & 3 deletions src/Elements/Db/SubmissionQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ protected function beforePrepare(): bool
if ($this->formId) {
$this->subQuery->andWhere(Db::parseParam($table . '.[[formId]]', $this->formId));

$form = Freeform::getInstance()->forms->getFormById($this->formId);
if ($form) {
$selectedForm = $form->getForm();
if (\is_numeric($this->formId)) {
$form = Freeform::getInstance()->forms->getFormById($this->formId);
if ($form) {
$selectedForm = $form->getForm();
}
}
}

Expand Down Expand Up @@ -216,6 +218,11 @@ protected function beforePrepare(): bool

$prefixedOrderList = [];
foreach ($this->orderBy as $key => $sortDirection) {
if (preg_match("/\(\)$/", $key)) {
$prefixedOrderList[$key] = $sortDirection;
continue;
}

if (\in_array($key, $orderExceptions, true) || preg_match('/^[a-z0-9_]+\./i', $key)) {
$prefixedOrderList[$key] = $sortDirection;
continue;
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/js/composer/app.js

Large diffs are not rendered by default.

0 comments on commit 37628c0

Please sign in to comment.