Skip to content

Commit

Permalink
fixing issue with output original params
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Jan 13, 2025
1 parent c4d6b9e commit de03021
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/).

## [3.0.16]

### Fixed

- `FD_PARAMS_ORIGINAL` output value.

## [3.0.15]

### Changed
Expand Down Expand Up @@ -302,6 +308,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a

- Initial production release.

[3.0.16]: https://github.com/infinum/eightshift-forms-utils/compare/3.0.15...3.0.16
[3.0.15]: https://github.com/infinum/eightshift-forms-utils/compare/3.0.14...3.0.15
[3.0.14]: https://github.com/infinum/eightshift-forms-utils/compare/3.0.13...3.0.14
[3.0.13]: https://github.com/infinum/eightshift-forms-utils/compare/3.0.12...3.0.13
Expand Down
14 changes: 13 additions & 1 deletion src/Rest/Routes/AbstractUtilsBaseRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ protected function getFormDetailsApi($request): array
$output[UtilsConfig::FD_STORAGE] = \json_decode($params['storage'] ?? '', true) ?? [];

// Set debug original params.
$output[UtilsConfig::FD_PARAMS_ORIGINAL] = sanitize_text_field($request);
$output[UtilsConfig::FD_PARAMS_ORIGINAL] = $this->getParamsOriginal($request);

return $output;
}
Expand Down Expand Up @@ -542,4 +542,16 @@ private function getFormDetailsApiDirectImport(array $params): array

return $output;
}

/**
* Get params original.
*
* @param mixed $request Data got from endpoint url.
*
* @return string
*/
private function getParamsOriginal($request): string
{
return \sanitize_text_field(\wp_json_encode($this->getRequestParams($request)));
}
}

0 comments on commit de03021

Please sign in to comment.