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

[Bug]: Bug in setParams function causing 0 to be returned as parameter value #17045

Open
JanVDB2000 opened this issue May 14, 2024 · 1 comment

Comments

@JanVDB2000
Copy link

Pimcore version

v10.5.19 maybe also in the 11v

Steps to reproduce

Description

When passing the parameters 'parking-number' and 'ground-parking' to the mail template in Pimcore Mail, the value 0 is returned instead of the expected value. Removing the hyphens "-" from the parameter names resolves the issue.

Steps to Reproduce

  1. Call the getMailData function with appropriate parameters.
  2. Pass the returned array to the mail template in Pimcore Mail.
  3. Check the value of 'parking-number' and 'ground-parking' in the mail template.

Possible Solution

that gives a message when the correct format has not been used

Code Snippet

php private function getMailData(MemberCard $paymentObject): array { 

$mailData = [];
$mailData['ground-parking'] = $paymentObject->getParking();
$mailData['parking-number'] = $paymentObject->getParking_number();

// ...

}

(new \Pimcore\Mail()) 
->from('noreply@test.com') 
->subject('Order : ' . $invoicenumber) 
->setDocument($emailDocumentAdmin) 
->setParams($this->getMailData($paymentObject)) 
->send();

Template mail

{{ parking-number }} {{ ground-parking }}

Actual Behavior

The value 0 is returned for 'parking-number and 'ground-parking' when passed to the mail template in Pimcore Mail.

Expected Behavior

The parameters 'parking-number' and 'ground-parking' should be correctly passed to the mail template without any modification needed. or that it gives a message when the correct format has not been used

@JanVDB2000 JanVDB2000 added the Bug label May 14, 2024
Copy link

github-actions bot commented Jun 4, 2024

Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

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

No branches or pull requests

1 participant