Closed (fixed)
Project:
Commerce Stripe
Version:
8.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Nov 2024 at 10:49 UTC
Updated:
18 Dec 2024 at 02:04 UTC
Jump to comment: Most recent
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]),
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
Comment #2
nicolas bouteille commentedBTW, 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?
Comment #3
tomtech commented@ 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.
Comment #4
nicolas bouteille commentedThanks 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
Comment #5
tomtech commentedThe (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.
Comment #6
nicolas bouteille commentedok thanks!
Comment #9
tomtech commented