Error creating Activities relationship form module builder

Hi, I’m having trouble creating a custom module from module builder.
I’ve found an error when I try to create the module with a relationship with Activities. Whenever I try to deploy the module I’m getting this error message in the view:

image

So, I’ve been debugging the functionality to find out what is giving me the error. It seems like suite is trying to make a require from a class that has some errors on it and thats making it to throw an exception that stops the code. More specifically the error is in modules/ModuleBuilder/parsers/relationships/RelationshipFactory.php. In the newRelationship function in the line 63 the class does a require_once to modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php. The code doesn’t complete the require.

I took a look to that file and it seems it has some errors. Using intelephense for Visual Studio Code is telling me that some functions are not compatible with the parent class:

image

This are the versions I’m using:
SuiteCRM: 7.14.0
PHP: 8.1.10

Any suggestions?

In file public/legacy/modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php, try changing this

public function buildLabels()

into this

public function buildLabels($update=false)

Yeah, that worked. Also had to change the parameters in the getLinkFieldDefinition method.

It would be cool if there was a better option than changing code outside of custom.

Should I open an issue on github or how does that kind of problems get resolved?

Yes, this is the typical simple PHP 8 fix that needs to go into core. If you can, please open the Issue, and you can even create a PR with the fix.

Pr that touch only one file are simple to create from Github. Just go to the file on the correct (hotfix) branch and click the pencil icon to edit the file.

Github will offer to create the fork for you. Then you will have to save twice: once for the commit, a second time for the PR with the commit. Github guides you with big green buttons so you know what to press.

1 Like

Good, already created the issue and the PR.

Thanks you so much for your help and for guiding me in the process. :wink:

1 Like