Overriding Datamanager Handler From One Extension in Another Extension

I have an extension with an object using a datamanager handler using the EnhancedDataManagerBase.
I then have a second extension that adds to and overrides some aspects of the original extension.
Preside objects, forms etc are working as expected but my handler in the second extension seems to be ignored.
In pseudo code the main extension handler looks like

// application/extensions/main-extension/handlers/admin/datamanager/myhandler.cfc

component extends="preside.system.base.EnhancedDataManagerBase" {


	private string function _defaultTab(){
		
		return "Some Default Content";
	}

and the other extension

// application/extensions/override-extension/myhandler.cfc

component extends="app.extensions.main-extension.handlers.admin.datamanager.myhandler" {


	private string function _defaultTab(){
		
		return "Some Custom Content";
	}

If I move the override handler into application/handlers/admin/datamanager it works as expected. Normally I would do it this way but in this case I’d like to group all the override functionality in its own extension, though that isn’t a deal breaker if it’s not recommended.
Just wondering if this is maybe a load order issue and if there is any way I can control that.

School boy error on my part!
It works as expected if I get the dependsOn attribute correct in the manifest.
I had omitted the preside-ext- part of the name and just gone with the last part of the extension name.

please share the manifest.json to display the complete solution for other people, thanks.

The corrected manifest looks like this

{
	  "id"        : "preside-ext-my-custom-extension"
	, "title"     : "custom extension to override default extension"
	, "author"    : "Me"
	, "version"   : "0.1.0"
	, "dependsOn" : [ "preside-ext-my-default-extension" ]

the incorrect version was

 "id"        : "preside-ext-my-custom-extension"
	, "title"     : "custom extension to override default extension"
	, "author"    : "Me"
	, "version"   : "0.1.0"
	, "dependsOn" : [ "my-default-extension" ]

note the difference in the dependsUpon attribute

1 Like

Here’s documentation about extensions: Preside Documentation :: Writing Extensions for Preside

I just learned about dependsOn. Never used before.

Yes, dependsOn is super useful for ensuring the load order of extensions (but does not provide dependency management beyond that).