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

Calls to non-existent method warning() of LoggerManager #10479

Open
SinergiaCRM opened this issue Aug 2, 2024 · 0 comments
Open

Calls to non-existent method warning() of LoggerManager #10479

SinergiaCRM opened this issue Aug 2, 2024 · 0 comments
Labels
Area: Clean Up Issues & PRs related to all things regarding to technical debt and log files Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Minor Function rarely used and has no impact Type: Bug Bugs within the core SuiteCRM codebase

Comments

@SinergiaCRM
Copy link
Contributor

SinergiaCRM commented Aug 2, 2024

Issue

The LoggerManager has a generic method __call() that is called in case a method is invoked that does not exist in the class. This __call() method locates the trace level configured in SuiteCRM and calls the related method, that is, if we have the error level configured, it will call the error() method and if we have fatal, it will call fatal(), and consequently, these messages are always shown in suitecrm.log

Possible Fix

No response

Steps to Reproduce the Issue

  1. Comment out the following code to be able to call cron.php from the URL (https://github.com/salesagility/SuiteCRM/blob/hotfix/cron.php#L50C1-L53C2)
$sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) != 'cli') {
sugar_die("cron.php is CLI only.");
}

and change the following line to cause it to enter the logger:

$cronUser = getRunningUser(); --> $cronUser = '';

  1. Set fatal as log level
  2. Call cron.php from the browser and check that the error message is displayed in suitecrm.log

[FATAL] cron.php: can't determine running user is displayed. No cron user checks will occur

  1. Configure error or any other log level
  2. Call cron.php from the browser and check that the error message is displayed in suitecrm.log

[CONFIGURED ERROR LEVEL] cron.php: can't determine running user. No cron user checks will occur_ has been printed

  1. Review the rest of the changes made in code

Context

No response

Version

8.14.3

What browser are you currently using?

Firefox

Browser Version

128.0.3 (64-bit)

Environment Information

MySQL, PHP Version 7.4.33

Operating System and Version

Ubuntu 22.04.4 LTS

@SinergiaCRM SinergiaCRM added the Type: Bug Bugs within the core SuiteCRM codebase label Aug 2, 2024
@johnM2401 johnM2401 added Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Area: Clean Up Issues & PRs related to all things regarding to technical debt and log files Severity: Minor Function rarely used and has no impact labels Aug 6, 2024
ManuSinergiaCRM pushed a commit to SinergiaTIC/SuiteCRM that referenced this issue Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Clean Up Issues & PRs related to all things regarding to technical debt and log files Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Severity: Minor Function rarely used and has no impact Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

2 participants