PAYONE-GmbH / magento-2

PAYONE Payment Extension for Magento 2
28 stars 56 forks source link

Placeholders aren't shown in Admin #426

Closed torhoehn closed 2 years ago

torhoehn commented 2 years ago

In the Admin it isn't possible to see possible placeholders for input fields, e. g.:

    <field id="narrative_text" translate="label,comment" type="textarea" sortOrder="485" showInDefault="1" showInWebsite="1" showInStore="1">
        <label>Narrative Text</label>
        <comment>Maximum 81 digits. Placeholders: {{order_increment_id}}</comment>
    </field>
Screenshot 2022-03-02 at 20 23 57

Installed Payone module version: 3.3.0 Magento version: 2.4.2-p1 with applied patches for MDVA-43395 and MDVA-43443

janteuber commented 2 years ago

Hello @torhoehn , Can you please describe in more detail where exactly this field is, what exactly is not possible, what you expect? Where exactly is the added value for a merchant?

torhoehn commented 2 years ago

@janteuber Sorry, but don't understand why I have to describe the value for the merchant. My code example is something out of this extension, so it's something you already wanted to show.

janteuber commented 2 years ago

Hello @torhoehn , As mentioned above, I need your specification on this issue. Thank you very much.

torhoehn commented 2 years ago

@janteuber The placeholder should be displayed in the admin (see comment under the textarea), otherwise it's not possible to configure the module properly, because the possible placeholders aren't known.

Compare the comment of the textarea to the code (this is what should be shown including the part in the curly brackets): <comment>Maximum 81 digits. Placeholders: {{order_increment_id}}</comment>

156434027-941d3cb0-5330-402b-ae38-009be1617dde
torhoehn commented 2 years ago

@janteuber Any update on this?

janteuber commented 2 years ago

Apparently the Magento2 framework prevents the use of double curly braces in language snippets.

Changed the placeholders to single curly brackets everywhere now - so they can be displayed there.

Old configurations with double curly brackets still work though.

Robert also noticed during testing that the "Dynamic refund message" was not used for the refund as expected, but the "Dynamic invoice message". He has also fixed this here.

janteuber commented 2 years ago

@torhoehn I I have just merged the PR: https://github.com/PAYONE-GmbH/magento-2/pull/457