magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Insert Variable popup missing template variables for new templates #23135

Closed roma84 closed 5 years ago

roma84 commented 5 years ago

After the following PR https://github.com/magento/magento2/pull/22469 was merged into 2.3-develop, you cannot anymore insert template variables in the newly created email templates.

Preconditions (*)

  1. Magento 2.3-develop

Steps to reproduce (*)

  1. Go to Marketing > Email Templates and press Add New Template button.
  2. Select some template (e.g. Contact Form) and press Load Template button.
  3. Press Insert Variable button.

Expected result (*)

  1. You should be able to insert template variables: vars1

Actual result (*)

  1. Template variables section missing: vars2
m2-assistant[bot] commented 5 years ago

Hi @roma84. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@roma84 do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


m2-assistant[bot] commented 5 years ago

Hi @stoleksiy. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

ghost commented 5 years ago

:white_check_mark: Confirmed by @stoleksiy Thank you for verifying the issue! :+1: Your confirmation will help us to acknowledge and process this report.

m2-assistant[bot] commented 5 years ago

Hi @shikhamis11. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

magento-engcom-team commented 5 years ago

:white_check_mark: Confirmed by @engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets MC-17239 were created

Issue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

roma84 commented 5 years ago

A possible solution for the issue:

  1. Revert changes made in PR https://github.com/magento/magento2/pull/22469
  2. Modify the following line instead: https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php#L194
--- a/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php
+++ b/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php
@@ -191,7 +191,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic
         }
         $template = $this->getEmailTemplate();
         if ($template->getId() && ($templateVariables = $template->getVariablesOptionArray(true))) {
-            $variables = array_merge_recursive($variables, $templateVariables);
+            $variables = array_merge_recursive($variables, [$templateVariables]);
         }
         return $variables;
     }
shikhamis11 commented 5 years ago

@roma84 , your changes seems working . you can prepare a pull request with your changes https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#pull_request

m2-assistant[bot] commented 5 years ago

Hi @maheshWebkul721. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction: