Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sjaak 1 post 71 karma points
    Feb 03, 2025 @ 08:22
    Sjaak
    0

    Commerce bulk/editor actions not loading

    Hi,

    I have created a bulk action but sometimes it is loading in the backoffice and sometimes it is not. If it is not appearing, a hard refresh makes the error always appear. It seems to be some kind of timing issue. In the browser console the following error shows up: Bulk action console error

    My code is like this:

    function initializeBulkActions() {
    angular.module('umbraco.commerce')
        .config(['ucActionsProvider', function (ucActionsProvider) {
            ucActionsProvider.bulkActions.push(["$q", "editorService", "changeDeliveryDateResource", function ($q, editorService, changeDeliveryDateResource) {
                return {
                    name: 'Delivery date',
                    icon: 'icon-box-open',
                    configure: function (items) {
                        return $q(function (resolve, reject) {
                            editorService.open({
                                view: '/App_Plugins/CustomCommerce/backoffice/views/dialogs/changedeliverydate.html',
                                size: 'small',
                                config: {
                                    storeId: items[0].storeId,
                                    deliveryDate: items[0].properties.DeliveryDate
                                },
                                submit: function (data) {
                                    resolve({
                                        deliveryDate: data
                                    });
                                },
                                close: function () {
                                    editorService.close();
                                    reject({
                                        message: "Bulk action was canceled."
                                    })
                                }
                            });
                        });
                    },
                    itemAction: function (item, data) {
                        return changeDeliveryDateResource.changeDeliveryDate(item.id, data.deliveryDate);
                    },
                    condition: function (ctx) {
                        return ctx.entityType == 'Order'
                    },
                    sortOrder: 110
                }
            }]);
        }]);
    }
    
    $(document).ready(initializeBulkActions);
    

    I saw this GitHub issue about this subject but it didn't give me the final answer: https://github.com/umbraco/Umbraco.Commerce.Issues/issues/563. We are using Umbraco Commerce 13.1.13 and we want to stay in Umbraco 13 because of LTS. Also I followed these docs https://docs.umbraco.com/umbraco-commerce/13.latest/key-concepts/bulk-actions.

    Hope someone here has the answer :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies