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

login method does not work for http rest api v4_1 using SuiteCRM 8.7.1, PHP 8.2.26 #582

Open
DavidGalicia opened this issue Dec 18, 2024 · 0 comments
Labels
Type: Bug Something isn't working

Comments

@DavidGalicia
Copy link

DavidGalicia commented Dec 18, 2024

Issue

When I call the login api method with the data that url percent encodes:

{
  "method": "login",
  "input_type": "JSON",
  "response_type": "JSON",
  "rest_data": "{\"user_auth\":{\"user_name\":\"api_user\",\"password\":\"a5a655a79dfd80008fea647a98c14ce7\"},\"application_name\":\"api-client\"}"
}

The server responds with an http 500 error status and does not return a session_id. On the server, I see the following error in /var/log/apache2/error.log:

[Tue Dec 17 14:01:49.212696 2024] [php:error] [pid 981:tid 981] [client 192.168.113.4:52174] PHP Fatal error:  Cannot declare class LanguageManager, because the name is already in use in /var/www/html/public/legacy/include/SugarObjects/LanguageManager.php on line 50

Possible Fix

To make the login method work and return a session_id I needed to fix the class re-declaration errors in /public/legacy/include/entryPoint.php and json decoding errors in /public/legacy/include/utils.php when clean_incoming_data() processes http rest api request data.

The changes are in the code fork here.

Steps to Reproduce the Issue

1. Call the `login` method of the v4_1 api
2. Check `/var/log/apache2/error.log` for errors

Context

No response

Version

8.7.1

What browser are you currently using?

Chrome

Browser Version

No response

Environment Information

PHP 8.2.26

Operating System and Version

Debian 12.8.0

@DavidGalicia DavidGalicia added the Type: Bug Something isn't working label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant