forked from salesagility/SuiteCRM
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Hotfix - General - Evitar errores en PHP 8 #477
Open
jordiSTIC
wants to merge
13
commits into
enhancement/coreUpgradeSuiteCRM7.14.4
Choose a base branch
from
bug/nonStaticCalls
base: enhancement/coreUpgradeSuiteCRM7.14.4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Hotfix - General - Evitar errores en PHP 8 #477
jordiSTIC
wants to merge
13
commits into
enhancement/coreUpgradeSuiteCRM7.14.4
from
bug/nonStaticCalls
+302
−81
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Actions executed at: 2024-11-13 08:53:54. |
jordiSTIC
changed the title
Hotfix - General - Evitar errores en PHP 8 por llamadas a funciones no estáticas como si lo fueran
Hotfix - General - Evitar errores en PHP 8
Nov 13, 2024
AlbertoSTIC
requested review from
enricsinergia
and removed request for
AlbertoSTIC
January 20, 2025 11:32
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Descripción
Este PR soluciona ciertos errores en PHP 8 encontrados en el core, al ejecutar la herramienta Rector en todo el código de SinergiaCRM.
Cambios realizados
Llamadas estáticas a funciones no estáticas
Se ha observado se realizan llamadas a funciones no estáticas como si éstas fueran estáticas, y esto provoca error en PHP 8:
Deprecated: Non-static method should not be called statically
:Uso de variable obsoleta $HTTP_SERVER_VARS
Hay accesos a la variable obsoleta
$HTTP_SERVER_VARS
. El soporte a esta variable se declaró obsoleto en la versión de php 5.4. Para corregir este error se debe substituir la variable$HTTP_SERVER_VARS
por$_SERVER
$HTTP_SERVER_VARS
por$_SERVER
Operaciones ternarias encadenadas sin paréntesis
En PHP 7.4 se declaró obsoleta la opción de poder encadenar operaciones ternarias sin paréntesis explícitos. En include/SugarFields/Parsers/QuickCreateMetaParser.php se asignaba el resultado de múltiples ternarias sin aplicar paréntesis.
Errores de sintaxis
Se observa una comparación errónea en include/Smarty/plugins/function.ext_includes.php:
Aparece la siguiente comparación:
En el código se evalúa
'.css' == 0
lo que se traduce a0 == 0
:if (strcasecmp(substr($file, -4), 0 == 0))
El paréntesis está mal puesto. Tendría que ser: