Hi,
this code

$statuses = WebhookEvent::getStatuses();
Html::getClass('webhook-event-' . strtolower($statuses[$webhook_event->status])),

will not work correctly on non-english sites because getStatuses() returns the translated value of the status.
Personally I created a separate function:

public static function getStatusesRaw(): array {
    return [
      self::STATUS_UNPROCESSED => 'unprocessed',
      self::STATUS_SUCCEEDED => 'succeeded',
      self::STATUS_FAILED => 'failed',
      self::STATUS_SKIPPED => 'skipped',
    ];
  }

and replaced the code with

Html::getClass('webhook-event-' . $statuses_raw[$webhook_event->status]),
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

nicolas bouteille created an issue. See original summary.

nicolas bouteille’s picture

BTW, I noticed you created both a view (available in views.view.commerce_stripe_webhook_event.yml) and a custom route with the overview callback. I figured you created the view first but then switched to the custom route as a replacement but never deleted the optional config file. Is that right?

tomtech’s picture

@ nicolas-bouteille Good catch on the status. Sorry I missed that. :-/

IRT the view/route, the view is the intended UX for the listing page, as it provides all the magic of views, e.g. filtering, adding/reordering fields, etc...

The route callback is a fallback. If the view is deleted or hijacked to another path, it provides a minimalist listing.

nicolas bouteille’s picture

Thanks for the quick reply!
Ok then if I am not mistaken, the view config is not imported.
I noticed commerce_stripe_webhook_event_update_9101 is responsible to import advancedqueue.advancedqueue_queue.commerce_stripe_webhook_event.yml
but their does not seem to be a code importing views.view.commerce_stripe_webhook_event.yml

tomtech’s picture

The (optional) configs are imported when the module is first enabled.

The queue functionality/config was added later, so the db update was created as a convenience to install it for anyone who already had the module installed.

Anyone doing a clean install of the module would get both installed from the config directory when the module is enabled(presuming requirements are met).

If the view is not installed, then most likely:
1. the views module was NOT installed when the submodule was first enabled
2. the view was manually deleted
3. config sync is being used, and the views config was not exported and saved. Then, a config import was done, deleting the view

You can easily re-create the view by going to config import in the UX, selecting import single item, selecting view, and then pasting in the contents of this config file.

nicolas bouteille’s picture

ok thanks!

  • tomtech committed afe64bb4 on 8.x-1.x
    Issue #3488118: Status icons on webhook events overview are broken on...
tomtech’s picture

Assigned: Unassigned » tomtech
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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