Help! Need info: Custom extension (PHP) server connect parameters for constructor in module class

Server: PHP

I’m trying to create a custom extension but I can’t find anywhere in the docs for the parameters for the constructor in module class. Please can you let me know ASAP as I’m completely stuck without it?

Cheers.

Happy New Year Jon!

Have you checked that?

Happy new year to you too, Tasos.

Yep, already used that thread but there’s no mention of the constructor there.

@patrick or @George, can you help me with this?

And this George’s post…

Haven’t tried to create a custom module (and it is in my ‘to do’ list)

Yep, that page doesn’t mention it either :frowning:

The output from the SC script contains this:

\/dmxConnectLib\/lib\/core\/Module.php","line":11,"message":"Too few arguments to function lib\\core\\Module::__construct(), 0 passed in

but there’s no information anywhere on what arguments should be provided.

A module UI arguments example from the above George’s Post:

The Module UI

You can place your Hjson file in extensions/server_connect/modules/mymodule.hjson
An example is:

{
  type: 'world_hello',
  module : 'world',
  action : 'hello',
  groupTitle : 'Custom Actions',
  groupIcon : 'fas fa-lg fa-database comp-data',
  title : 'Hello World',
  icon : 'fas fa-lg fa-table comp-data',
  dataScheme: [
    {name: 'name', type: 'text'},
    {name: 'age', type: 'number'}
  ],
  dataPickObject: true,
  globalVars: {
    '$_GET' : [
			{name: 'sort', type: 'text'},
			{name: 'dir', type: 'text'}
  		   ]
  },
  properties : [
    {
      group: 'Hello Properties',
      variables: [
        { name: 'actionName', optionName: 'name', title: 'Name', 
          type: 'text', required: true, defaultValue: ''},
        { name: 'actionData', optionName: 'data', title: 'Data',
          type: 'text', defaultValue: ''}
      ]
    }
  ]
}

What arguments have you defined in your module?

Hi Jon, Happy New year

The error is generated within the file core.php at line 11 and appears, as you identify, to be a parameter issue.

    public function repeat($options) {

However i think this message may be misleading as the function __construct() appears in dmxDatabase.php

	public function __construct($code, $message, $file, $line, $trace = NULL) {
		$this->code = $code;
		$this->message = $message;
		$this->file = $file;
		$this->line = $line;
		$this->trace = $trace;
	}

__construct() looks, on quick examination, to be the function which outputs the error message rather than the actual function in error.

One for the team I think but my gut feeling is that there may be an issue with the formatting of your parameters for your module leading to a failure in the parsing of the parameters when the functions tried to parse them leading to the error.

Sorry i cant be more help, time limited, but hope this at least stops you going down a dead end which i think the construct() reference may be.

Hi Jon,

I’m really interested in this one…

Have you found a way to work or at least more help on documentation?

Hi Brian. Happy new year to you too!

Thanks for your input. I posted the bit of the output in the hope it was helpful to the team to give more detail but I think I really need them to come back with the missing info.

Cheers, Jon.

Nope, I’ve hit a wall on this until someone from the team can give me the info needed.

The documentation is definitely lacking.

Cheers.

Can I bump this up please? I’m completely stuck until I get the additional documentation.

Sorry to chase. Is there any chance of some more information so I can finish this?

Maybe post your extension code so that we can see what you are doing.

Thanks Teodor. I will send it to you but there is a fundamental issue of lack of documentation so it would benefit everyone if that was addressed rather than you just assist me as an isolated case.

There’s already documentation about the custom extensions for Server Connect and it’s already posted in this topic. The error you see is related to an error in your code, not something that we didn’t document.

What are the arguments for the constructor in module class? The error says there are too few arguments but I can’t find any reference to what it’s expecting.

That is why we need to see your code!

@Teodor - I’ve just PM’d you.