Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: broken UX, broken API specs #9375

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

myfluxi
Copy link

@myfluxi myfluxi commented Nov 23, 2021

  • Avoids the following error, an error-message in frontend and a broken UX

[error] 94446#0: *1056 FastCGI sent in stderr: "PHP message: PHP Notice: Trying to access array offset on value of type null in SuiteCRM/modules/AOW_WorkFlow/AOW_WorkFlow.php on line 177

Description

  • With an empty list of workflow the following error is visible in frontend:

Error occured while fetching metadata

  • Browser console shows:

ERROR Error: Uncaught (in promise): Error: Internal server error

  • nginx says:

[error] 94446#0: *1056 FastCGI sent in stderr: "PHP message: PHP Notice: Trying to access array offset on value of type null in SuiteCRM/public/legacy/modules/AOW_WorkFlow/AOW_WorkFlow.php on line 177

In a fresh install, add WorkFlow to the main menu and try to access it. Error is shown.

Motivation and Context

This change solves a broken UX.

How To Test This

See above

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

* Avoids the following error, an error-message in frontend and a broken UX

[error] 94446#0: *1056 FastCGI sent in stderr: "PHP message: PHP Notice:  Trying to access array offset on value of type null in SuiteCRM/modules/AOW_WorkFlow/AOW_WorkFlow.php on line 177
@SuiteBot
Copy link

SuiteBot commented Nov 23, 2021

CLA assistant check
All committers have signed the CLA.

Avoids server error:

PHP message: PHP Deprecated:  Non-static method StudioParser::buildImageButtons() should not be called statically in /Users/trumva/PhpstormProjects/SuiteCRM-Core/public/legacy/modules/Studio/wizards/RenameModules.php on line 339
Presently we do not comply with JSON:API specs, see:
  https://jsonapi.org/format/#error-objects

This leads to incompatibility with proper PSR-7 implementations
such as https://github.com/Nyholm/psr7 (recommended by Symfony).

  "Warning: array_key_exists() expects parameter 2 to be array, int given"

Sadly we cannnot use excellent JSON API Client packages such as:
  https://github.com/eosnewmedia/JSON-API-Client

It is not possible to extend the deserializer because at this point
we lost the required array key (e.g. 'status').

Thus do it the proper way and make our error response compatible with specs.

TODO (maybe): There is another issue with the prefixed Api V8 and 'module'
string but this issue can be worked around.
@myfluxi myfluxi changed the title Check string array Fixes: broken UX, broken API specs Nov 24, 2021
@jack7anderson7
Copy link
Contributor

Hi @myfluxi,

Could you please update your pull request to point to the hotfix-7.10.x branch.

Thanks,
Jack

@jack7anderson7 jack7anderson7 added the PR:Wrong Branch Pull requests that point towards a restricted branch such as master label Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR:Wrong Branch Pull requests that point towards a restricted branch such as master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants