globaltoolbar callback only working in clientresources debug=true mode??

Vote:
 

Hello,

We have some custom buttons that we load up in the global toolbar section of the CMS.  We are using the ModuleInitializer method of doing so and this works great, but ONLY when EpiServerFramework.config has the clientresources debug="true" setting - if it's false then this identifier never gets registered - i see stuff for the publishmenu key coming back but nothing ever for the globaltoolbar.  Is there a reason for this?

Thanks!

Mike

#122709
Jun 10, 2015 19:41
Vote:
 

Here's our module intializer:

define([
// Dojo
    "dojo",
    "dojo/_base/declare",
    "dojo/aspect",
//CMS    
    "epi/_Module",
    "epi/dependency",
    "epi/routes",
//PhoenixCMS
    "phoenixcms/Commands/ScaffoldCommand",
    "phoenixcms/Commands/CMSHelpCommand"
    ],
    function (
    // Dojo    
        dojo,
        declare,
        aspect,
    //CMS    
        _Module,
        dependency,
        routes,
        ScaffoldCommand,
        CMSHelpCommand
        ) {

        return declare([_Module], {
            // summary: Module initializer for the default module.         
            initialize: function () {
                this.inherited(arguments);

                //Register the store
                var storeregistry = this.resolveDependency("epi.storeregistry");
                storeregistry.create("phoenixcms.testreststore", this._getRestPath("TestRestStore"));
                storeregistry.create("phoenixcms.bbbtagreststore", this._getRestPath("BBBTagRestStore"));
                storeregistry.create("phoenixcms.bbbbundlecodereststore", this._getRestPath("BBBBundleCodeRestStore"));
                storeregistry.create("phoenixcms.givetagreststore", this._getRestPath("GiveTagRestStore"));
                storeregistry.create("phoenixcms.givebundlecodereststore", this._getRestPath("GiveBundleCodeRestStore"));
                storeregistry.create("phoenixcms.bbbbaselinescheduledscaffoldreststore", this._getRestPath("BBBBaselineScheduledScaffoldRestStore"));

                //Register global toolbar commands
                var handle,
                    registry = dependency.resolve("epi.globalcommandregistry"),
                    callback = function (identifier, provider) {

                        if (identifier == "epi.cms.globalToolbar") {  
                            provider.addCommand(new ScaffoldCommand(), { showLabel: true, id: "ScaffoldCommand" });
                            provider.addCommand(new CMSHelpCommand(), { showLabel: true, id: "CMSHelpCommand" });
                        }
                        else {
                            return;
                        }

                        handle.remove();
                        
                    };

                handle = aspect.after(registry, 'registerProvider', callback, true);
            },

            _getRestPath: function (name) {
                return routes.getRestPath({ moduleArea: "app", storeName: name });
            }
        });
    });
#122710
Jun 10, 2015 19:42
Vote:
 

I'll also note that our nuget packages for:

Episerver.CMS.UI, Episerver.CMS.UI.Core, and Episerver.CMS.UI.Sources are all 8.2.1

#122711
Jun 10, 2015 19:46
Vote:
 

Hi, Did you find any solution for this? I have exactly the same problem.

// Regards

#179929
Jun 26, 2017 12:26
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.