Skip to content

Fix undefined variable in AJAX remove after market→repo migration#3118

Open
kwizer15 wants to merge 2 commits intojeedom:developfrom
kwizer15:fix/repo-ajax
Open

Fix undefined variable in AJAX remove after market→repo migration#3118
kwizer15 wants to merge 2 commits intojeedom:developfrom
kwizer15:fix/repo-ajax

Conversation

@kwizer15
Copy link
Copy Markdown
Contributor

Description

Cette PR corrige un problème détecté par PHPStan : une variable $market était utilisée sans avoir été définie au préalable dans le processus de suppression de dépôt via AJAX.

En analysant le code, il semble que la variable $repo était initialement utilisée mais a été renommée en $market à un moment donné, probablement lors d'une évolution du système. Cependant, l'assignation de la variable n'avait pas été mise à jour en conséquence.

Le correctif renomme $repo en $market dans l'assignation pour maintenir la cohérence avec le reste du code qui utilise cette variable.

Suggested changelog entry

Correction d'une variable non définie détectée par PHPStan lors de la suppression de dépôt via AJAX

Related issues/external references

N/A

Types of changes

  • Bug fix (non-breaking change which fixes)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
    • This change is only breaking for integrators, not for external standards or end-users.
  • Documentation improvement

PR checklist

@zoic21
Copy link
Copy Markdown
Contributor

zoic21 commented Jan 30, 2026

Je suis pas sur l'idée était d'avoir plusieurs source repo (market) possible. Aujourd'hui on a que market mais demain on pourrait en avoir plus.

@kwizer15
Copy link
Copy Markdown
Contributor Author

Je suis pas sur l'idée était d'avoir plusieurs source repo (market) possible. Aujourd'hui on a que market mais demain on pourrait en avoir plus.

Je comprend tes doutes. L'objectif ici c'est de fixer en l'état. Pour gérer plusieurs repo tu pourras créer une interface avec la méthode static byId, et dans ce code tu vérifies que ta classe implemente bien la nouvelle inerface. Ca prend 5 minutes à faire. Seulement, encore une fois, ce n'était pas l'objectif ici.

@Salvialf Salvialf changed the base branch from alpha to develop March 31, 2026 18:13
@Mips2648
Copy link
Copy Markdown
Collaborator

I've adapted the correction so the actual issue and fix is more clear

@zoic21 the issue was that the $market variable used was not defined, the correct variable to use is $repo
Could please review if you agree with the change now?

@kwizer15 I know it could be that $class = 'repo_' . init('repo'); will end with a class that doesn't exists if init('repo') is incorrect but

  1. it is slightly improbable
  2. it is another issue than the purpose of the PR and I think that's what brings the confusion

for this 2 reason I propose to address that later, if need be

@Mips2648 Mips2648 removed the Invalid label Apr 16, 2026
@Mips2648 Mips2648 requested review from Mips2648 and zoic21 April 16, 2026 21:22
@kwizer15
Copy link
Copy Markdown
Contributor Author

for this 2 reason I propose to address that later, if need be

ok, that works for me

@Mips2648 Mips2648 added changelog-fix Use to generate release notes / changelog To be apply on PR Need review labels Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-fix Use to generate release notes / changelog To be apply on PR Need review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants