Module builder and adding relationship fails in PHP 7.1 #1785

Closed
opened 2026-02-20 15:15:30 -05:00 by deekerman · 4 comments
Owner

Originally created by @craigpanton on GitHub (Mar 21, 2017).

Issue

When trying to save and deploy a new relationship via Studio, I receive a stack trace error and it does not create the new relationship. I receive a similar output when trying to deploy a new module via module builder.

Expected Behavior

It is expected to deploy the relationship/module to the local instance of SuiteCRM.

Actual Behavior

It was failing to create the relationship. In the case of the module builder it hangs on the deployment screen.

Possible Fix

The error itself is due to the DeployedRelationships and UndeployedRelationship build function missing expected parameters (the line for the relationship bug is on modules/ModuleBuilder/Controller.php 580).
It looks like it may be due to error handling within php version 7.1 as when I try in 5.6 it throws the same errors however continues on and works as expected.

Steps to Reproduce

  1. Go to studio
  2. Select a module
  3. Select 'Relationships'
  4. Select 'Add Relationship'
  5. Provide any details
  6. Select 'Save & Deploy'

Your Environment

  • SuiteCRM Version used: 7.8.2
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome/Firefox
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.1.2, MySQL 5.6.35
  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 16.04
Originally created by @craigpanton on GitHub (Mar 21, 2017). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> #### Issue <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> When trying to save and deploy a new relationship via Studio, I receive a stack trace error and it does not create the new relationship. I receive a similar output when trying to deploy a new module via module builder. #### Expected Behavior <!--- Tell us what should happen --> It is expected to deploy the relationship/module to the local instance of SuiteCRM. #### Actual Behavior <!--- Tell us what happens instead --> It was failing to create the relationship. In the case of the module builder it hangs on the deployment screen. #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> The error itself is due to the DeployedRelationships and UndeployedRelationship build function missing expected parameters (the line for the relationship bug is on modules/ModuleBuilder/Controller.php 580). It looks like it may be due to error handling within php version 7.1 as when I try in 5.6 it throws the same errors however continues on and works as expected. #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Go to studio 2. Select a module 3. Select 'Relationships' 4. Select 'Add Relationship' 5. Provide any details 6. Select 'Save & Deploy' #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.8.2 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome/Firefox * Environment name and version (e.g. MySQL, PHP 7): PHP 7.1.2, MySQL 5.6.35 * Operating System and version (e.g Ubuntu 16.04): Ubuntu 16.04
Author
Owner

@ghost commented on GitHub (Mar 28, 2017):

Same here but with PHP 7.1.3x64 and MS SQL 2014.
Going to PHP 7.0.17 resolves the issue for me.

Full stack trace for deploy operation:

[28-Mar-2017 09:57:00 Europe/Ljubljana] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function UndeployedRelationships::build(), 1 passed in \modules\ModuleBuilder\MB\MBModule.php on line 429 and exactly 3 expected in \modules\ModuleBuilder\parsers\relationships\UndeployedRelationships.php:228
Stack trace:
#0 \modules\ModuleBuilder\MB\MBModule.php(429): UndeployedRelationships->build('custom\modulebu...')
#1 \modules\ModuleBuilder\MB\MBPackage.php(213): MBModule->build('custom\modulebu...')
#2 \modules\ModuleBuilder\MB\MBPackage.php(315): MBPackage->buildInstall('custom\modulebu...')
#3 \modules\ModuleBuilder\controller.php(237): MBPackage->build(false)
#4 \include\MVC\Controller\SugarController.php(446): ModuleBuilderController->action_DeployPackage()
#5 \include\MVC\Controller\SugarController.php(419): SugarController->do_action()
#6 \include\MVC\Controller\SugarController.php(394): SugarC in \modules\ModuleBuilder\parsers\relationships\UndeployedRelationships.php on line 228

@ghost commented on GitHub (Mar 28, 2017): Same here but with PHP 7.1.3x64 and MS SQL 2014. Going to PHP 7.0.17 resolves the issue for me. Full stack trace for deploy operation: [28-Mar-2017 09:57:00 Europe/Ljubljana] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function UndeployedRelationships::build(), 1 passed in \modules\ModuleBuilder\MB\MBModule.php on line 429 and exactly 3 expected in \modules\ModuleBuilder\parsers\relationships\UndeployedRelationships.php:228 Stack trace: #0 \modules\ModuleBuilder\MB\MBModule.php(429): UndeployedRelationships->build('custom\\modulebu...') #1 \modules\ModuleBuilder\MB\MBPackage.php(213): MBModule->build('custom\\modulebu...') #2 \modules\ModuleBuilder\MB\MBPackage.php(315): MBPackage->buildInstall('custom\\modulebu...') #3 \modules\ModuleBuilder\controller.php(237): MBPackage->build(false) #4 \include\MVC\Controller\SugarController.php(446): ModuleBuilderController->action_DeployPackage() #5 \include\MVC\Controller\SugarController.php(419): SugarController->do_action() #6 \include\MVC\Controller\SugarController.php(394): SugarC in \modules\ModuleBuilder\parsers\relationships\UndeployedRelationships.php on line 228
Author
Owner

@ghost commented on GitHub (Mar 28, 2017):

Whoops not true...
7.0.17 does deploy it, but when you enter data in deployed module WSOD happens.
Switched to PHP 5.6.30, redeployed same module, quick repair and now it works.

So SuiteCRM is not compatible with PHP 7.X at least custom modules are not.

@ghost commented on GitHub (Mar 28, 2017): Whoops not true... 7.0.17 does deploy it, but when you enter data in deployed module WSOD happens. Switched to PHP 5.6.30, redeployed same module, quick repair and now it works. So SuiteCRM is not compatible with PHP 7.X at least custom modules are not.
Author
Owner

@craigpanton commented on GitHub (Mar 28, 2017):

It looks like argument count for user defined functions was upgraded from a warning to an error with PHP7.1 as per http://php.net/manual/en/migration71.incompatible.php. The only obvious solution I've found to that so far is to pass null parameters over for those functions.

@craigpanton commented on GitHub (Mar 28, 2017): It looks like argument count for user defined functions was upgraded from a warning to an error with PHP7.1 as per http://php.net/manual/en/migration71.incompatible.php. The only obvious solution I've found to that so far is to pass null parameters over for those functions.
Author
Owner

@Dillon-Brown commented on GitHub (Apr 3, 2017):

@craigpanton @gregecslo I've put up a PR for this issue. Let me know if this solves it on your end :).

@Dillon-Brown commented on GitHub (Apr 3, 2017): @craigpanton @gregecslo I've put up a PR for this issue. Let me know if this solves it on your end :).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#1785
No description provided.