Skip to content

Normalize entry params - #2004

Open
alexej-d wants to merge 3 commits into
pimcore:2026.xfrom
alexej-d:2026.x
Open

Normalize entry params#2004
alexej-d wants to merge 3 commits into
pimcore:2026.xfrom
alexej-d:2026.x

Conversation

@alexej-d

Copy link
Copy Markdown

Changes in this pull request

Resolves #321

Additional info

Needed in addition to the main patch.

Copilot AI balanced review requested due to automatic review settings August 19, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jcPimcore jcPimcore self-assigned this Aug 19, 2026
@jcPimcore
jcPimcore requested a balanced review from Copilot August 19, 2026 11:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/Email/Service/EmailLogService.php:181

  • The linked issue and “main patch” are about adding search/filtering to the sent-mails list, but this change only alters the email-parameter response. It neither implements nor supports the /emails/search flow in UI PR #3946, so it cannot resolve the cited issue as described. Please correct the PR description/linkage if this normalization is the intended scope, or include the backend search support that the description claims.
                $this->normalizeParamValue($value)

@jcPimcore jcPimcore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix — EmailLogEntryParameter's constructor requires ?string under strict_types=1, but Mail::setParam() accepts mixed, so any logged email with a bool/int/array template param would TypeError on GET /emails/{id}/params. normalizeParamValue() fixes this at the right spot (the service producing the value, not the schema contract), and correctly leaves the resend path (setEmailDocumentContent) untouched since that needs the original typed value.

One ask before merging: this repo has a solid per-service unit-test convention (tests/Unit/<Module>/Service/*ServiceTest.php), but there's no tests/Unit/Email suite at all. Since this fixes an actual crash, could you add a small test for getEntryParams()/normalizeParamValue covering bool/int/array values?

@jcPimcore jcPimcore added this to the 2026.2.7 milestone Aug 19, 2026
@alexej-d

Copy link
Copy Markdown
Author

Good fix — EmailLogEntryParameter's constructor requires ?string under strict_types=1, but Mail::setParam() accepts mixed, so any logged email with a bool/int/array template param would TypeError on GET /emails/{id}/params. normalizeParamValue() fixes this at the right spot (the service producing the value, not the schema contract), and correctly leaves the resend path (setEmailDocumentContent) untouched since that needs the original typed value.

One ask before merging: this repo has a solid per-service unit-test convention (tests/Unit/<Module>/Service/*ServiceTest.php), but there's no tests/Unit/Email suite at all. Since this fixes an actual crash, could you add a small test for getEntryParams()/normalizeParamValue covering bool/int/array values?

Check the new commit @jcPimcore

@jcPimcore

Copy link
Copy Markdown
Contributor

Confirmed — EmailLogServiceTest::testGetEntryParamsNormalizesNonStringValues correctly exercises the fixed path (bool → 'true', int → '118', array → JSON) and matches this repo's Codeception/makeEmpty convention. Thanks!

@jcPimcore

Copy link
Copy Markdown
Contributor

Hi @alexej-d
Thank you for the update! Looks good! 👍
Since it is related to pimcore/studio-ui-bundle#3946 we will not merge this immediately but waiting for the other PR.

@sonarqubecloud

Copy link
Copy Markdown

@alexej-d

Copy link
Copy Markdown
Author

Hi @alexej-d Thank you for the update! Looks good! 👍 Since it is related to pimcore/studio-ui-bundle#3946 we will not merge this immediately but waiting for the other PR.

I have adjusted my code in both bundles @jcPimcore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants