mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Module builder and adding relationship fails in PHP 7.1 #1785
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#1785
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
Your Environment
@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):
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.
@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.
@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 :).