Doing 'Send shipment' or 'Cancel shipment' should add a log entry to Order activity.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tko created an issue. See original summary.

tko’s picture

Category: Support request » Feature request
thetwentyseven’s picture

We needed the same functionality so I created a patch

jsacksick’s picture

Status: Active » Needs work

we need to put this logic in a different event subscriber, that is registered conditionally (i.e only when the commerce_log module is installed), otherwise this logic would crash.

Additionally, we need tests coverage for this logic.

jsacksick’s picture

following our Slack discussion, CommerceShippingServiceProvider needs to register a new subscriber, only if commerce_log is enabled.

The subscriber can be called ShipmentLogSubscriber.

jsacksick’s picture

Issue tags: +Needs tests
jsacksick’s picture

Also, let's not hardcode the link to the shipment in the log template but instead pass a {{ shipment_url}} or something.

Note that we need a Kernel test asserting that the log messages are correctly generated (See OrderIntegrationTest under commerce_log for an example).

Let's call it LogIntegrationTest.

thetwentyseven’s picture

Thank you very much for your time. I am afraid I do not have time right now to do the test. But I will try as soon as I can.

thetwentyseven’s picture

Sorry forgot to import class

thetwentyseven’s picture

anybody’s picture

@thetwentyseven would you mind creating the final fix as MR? And still needs tests.

chizh273 made their first commit to this issue’s fork.

chizh273’s picture

Assigned: Unassigned » chizh273

chizh273’s picture

Assigned: chizh273 » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new120.06 KB

I have created MR from the last patch and also have added tests.

The "PHPUnit" pipeline job failed because of FunctionalJavascript tests, the new ShipmentLogSubscriberTest was passed successfully

the ShipmentLogSubscriberTest result

khiminrm made their first commit to this issue’s fork.

khiminrm’s picture

Status: Needs review » Reviewed & tested by the community
rszrama’s picture

Title: Send shipment doesn't log anything to Order activity » Log shipment state transitions to the order activity stream

  • jsacksick committed a72bd10a on 8.x-2.x authored by chizh273
    Issue #3159002 by thetwentyseven, khiminrm, chizh273, jsacksick, tko,...
jsacksick’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.