Skip to content

Conversation

@Tomasz-Silpion
Copy link
Member

Description (*)

Related Pull Requests

  • see OpenMage/magento-lts#<issue_number>

Fixed Issues (if relevant)

  • fixes OpenMage/magento-lts#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)

Copilot AI review requested due to automatic review settings December 16, 2025 00:27
@github-actions github-actions bot added the Component: Adminhtml Relates to Mage_Adminhtml label Dec 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds return type declarations and improves the extensibility of admin email preview templates by changing how default templates are retrieved.

  • Added return type declaration (: array) to getTemplateOptions() method
  • Modified template retrieval to use model instance instead of static call, allowing method override in custom modules

public function getTemplateOptions(): array
{
return Mage_Core_Model_Email_Template::getDefaultTemplatesAsOptionsArray();
return Mage::getModel('core/email_template')->getDefaultTemplatesAsOptionsArray();
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

Creating a new model instance on every call to getTemplateOptions() is inefficient. Consider instantiating the model once and reusing it, or caching the result if the templates don't change frequently during a request.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2025

Test Results

963 tests  ±0   955 ✅ ±0   16s ⏱️ ±0s
212 suites ±0     8 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3ee2119. ± Comparison against base commit bf3b298.

♻️ This comment has been updated with latest results.

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

Labels

Component: Adminhtml Relates to Mage_Adminhtml

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants