Commerce order email backward compatibility

Created on 16 June 2023, over 1 year ago
Updated 11 August 2023, over 1 year ago

Problem/Motivation

With the new 1.3rc1 release updating to it breaks order emails. It displays the order entity instead of using the template file. This happens without enabling the commerce order override.

Steps to reproduce

Install 1.2 on a commerce site with order receipt emails enabled.
Resend an email for an order to see the current email template.
Upgrade to 1.3rc1.
Resend an email for an order to see the new email, which just displays an order entity without formatting or any other information.

Proposed resolution

Workaround: on page /admin/config/system/mailer/override, run "Delete" for "Commerce order".

πŸ› Bug report
Status

Fixed

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rhovland
  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon
  • πŸ‡¬πŸ‡§United Kingdom adamps

    It works OK for me.

    In 1.3.0-beta2 there was πŸ› Caching bug enabling/disabling overrides Fixed which sounds much like what you describe. It was fixed in rc1. Also try clearing caches.

    Continue providing backwards compatibility if the override is not enabled until 2.x.

    This was in the IS, proposed resolution section. Yes absolutely, this is the way it's supposed to workπŸ˜ƒ. This is a description of "expected behaviour". The proposed resolution is instead to describe the changes needed to solve the bug.

  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

    I'm not sure what that issue has to do with this issue. This issue is that backwards compatibility for commerce invoice emails was removed. It is no longer present in the module. I am not sure if that is intentional or if this is a mistake that needs to be fixed.

  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon
  • πŸ‡¬πŸ‡§United Kingdom adamps

    Did you try clearing caches?

    The backwards compatibility module has been uninstalled in an update hook and all code removed.

    This is expected - see change record β†’ . The explanation is in the 1.3.0-beta1 release note, and I have just added it to the 1.3.0-rc1 release note.

    I'm not sure what that issue has to do with this issue.

    The symptoms you describe seem very similar to the issue I linked to, that's why I linked it.

    I was under the impression that breaking changes are intended for 2.x in this module.

    Yes exactly. If we can find the bug then we should fix it. However at the moment I can't reproduce it - I followed your steps and it works for me.

  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

    I will attempt to do some more debugging on this but I'm still unclear what code handles commerce order email sending when the override is disabled. It definitely is not using the existing twig template like it did in 1.2.

  • πŸ‡¬πŸ‡§United Kingdom adamps

    I will attempt to do some more debugging

    Great thanks

    It definitely is not using the existing twig template (in my project) like it did in 1.2.

    It should be that template. If it's not then this is a bug. πŸ› Caching bug enabling/disabling overrides Fixed caused a bug in this area, which could be fixed by clearing caches. If you previously installed 1.3.0-beta2 then the bug could still exist on 1.3.0-rc1 until you clear caches.

  • πŸ‡¬πŸ‡§United Kingdom Rob-PS

    "It definitely is not using the existing twig template (in my project) like it did in 1.2."
    I found the same problem in a test, even after clearing the cache.

    The first entry in the received email is an comment box to add a new comment.
    I see the order log history in the top in the outgoing email.
    If I create a dummy order as admin I see in the email result on the last lines two buttons "validate or cancel the order".
    Customers do not see these buttons. The IP address of teh one placing an order is also visible in the email.

    I had to revert back to 1.2. The order confirmation twig file is definitly not used.

  • πŸ‡¬πŸ‡§United Kingdom Rob-PS

    I discovered that the following steps resolves the issue that it does not pick up the order confirmation twig (in my case in my own theme).
    After adding the module and running drush updatedb:
    clear cache
    - enable the setting "Commerce order Warning: Experimental, may change Disabled Order type settings"
    clear cache
    - disable Commerce order Warning: Experimental, may change Enabled & imported Order type settings
    clear cache
    the final setting must be "the setting "Commerce order Warning: Experimental, may change Disabled Order type settings"

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡¬πŸ‡§United Kingdom adamps

    I did manage to reproduce this once however I can't do it again nowπŸ˜ƒ. In my experience this is a glitch - it requires a specific condition during the upgrade to create the problem. Also it's easy to fix and once fixed, it's not likely to come back.

    What's happened is that the commerce override is not properly enabled nor properly disabled. It's halfway in between. The code for the override is running, however the related configuration is missing. The problem can be fixed by either enabling or disabling the override - similar to #10 although you can shortcut, and pick "delete" instead of "enable" then "disable".

    The next step would be to create a detailed sequence of steps that will reproduce, starting from a clean install. The "steps to reproduce" in the issue summary often doesn't reproduce - it depends on some other settings.

    This may only affect a small number of sites, and there is an easy workaround, which I could even mention in the release note if someone else can confirm it. So maybe we won't need/manage to fix it.

  • πŸ‡³πŸ‡ΏNew Zealand andyd328 Lyttelton, NZ πŸ‡³πŸ‡Ώ

    I just ran into this on upgrading to 1.3.0-rc1 from 1.2.1 as well but don't have anything to add to the

    It seems from the above that we can either have the correct email template or have multiple BCC addresses, but not currently both. Is that correct?

  • πŸ‡¬πŸ‡§United Kingdom adamps

    It seems from the above that we can either have the correct email template or have multiple BCC addresses, but not currently both. Is that correct?

    If you run the workaround in this issue you should have a working site. After that you have 2 choices:

    • Override: uses a new template, and allows many more options including multiple BCC address
    • Don't override: works exactly as Commerce does with the old template and whatever limitations before
  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon

    I see a duplicate issue was opened and fixed
    πŸ› Update from 1.2 to 1.3 breaks existing order receipt emails Fixed

  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States rhovland Oregon
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024