"key [admin] doesn't exist" when using alt-theme extension

I played around with the alternative admin theme extension and did all changes I need to get the top Menu shown correctly.

Everything is fine locally.

But when pushing it to my server I get the following error:
key [admin] doesn't exist

And it happens here:
ext-cme/config/config.cfc (7)

component {
	public void function configure( required struct config ) {
		var settings = arguments.config.settings?:{};

		settings.adminSideBarItems.append( "cme" );
    settings.admin.topNavItems.append( "cme" );  // <--- Here's the error

    settings.adminMenuItems.cme = {
        icon          = "fa-mortar-board"
      , title         = "CME"
      , subMenuItems  = [ "cme_fragebogen", "cme_exam" ]
    };

    settings.adminMenuItems.cme_fragebogen = {
        buildLinkArgs = { objectName="cme_fragebogen" }
      , activeChecks  = { datamanagerObject="cme_fragebogen" }
      , title         = "B&ouml;gen"
    };

This led me to the conclusion: The loading order of the extensions is different on dev and live.

What I did next was putting this in my main config.cfc:

settings.admin = {
	  topNavItems     = []
	, topNavMenuIcons = true
	, favicon         = "/preside/system/assets/images/logos/favicon.png"
	, adminAvatarSize = 56
	, customCss       = []
};

What happened then was: The top navigation elements defined in the alt-theme extension were gone. Two of my extension menus were shown now, but my extension cme is still missing in the navigation.

I’ve moved the settings.admin part from my main config to the preside config and now the system menu entries (Assets, Datamanager, etc.) are shown, and my top menu items defined in my application config.cfc.
But: The menu entries of my extensions are still missing!

This brings me again to the conclusion, that the loading order of the exensions affects this:

  • First my extensions are loaded and added to the topNavi
  • then the alt theme extensions overrides it (config._configureAdminTheme)
  • and then the menu entries of my application config is added.

Two questions:

  1. Why is the loading order on my dev and live machine is different?
  2. How can I manipulate the loading order? Is it alphabetical? (but why question 1 then?)

Hint: I’ve not installed the laucher extension which the alt theme extension depends on.

Not sure on that one

You can and should use dependsOn in your extensions manifest.json file. See Preside Documentation :: Writing Extensions for Preside.