Skip to content

[fix] View.hDate — Invalid call dans les templates Distributions et ContractAdmin#150

Merged
InterAMAP44 merged 1 commit into
stagingfrom
mantis-327-fix
Jun 27, 2026
Merged

[fix] View.hDate — Invalid call dans les templates Distributions et ContractAdmin#150
InterAMAP44 merged 1 commit into
stagingfrom
mantis-327-fix

Conversation

@Mandrak-Kimigo

Copy link
Copy Markdown
Member

[fix] View.hDate — Invalid call dans les templates Distributions et ContractAdmin

Contexte

La v3.0.8 (merge staging→master) introduit une régression sur deux pages :

  • Menu Distributions (/distribution)
  • Menu ContractAdmin / Commandes (/contractAdmin/view/…)

Les deux affichent Invalid call au rendu Templo de ::hDate(d.date)::.

Cause

Le commit bdbbd8de a ajouté ?year:Bool = false à View.hDate. Or,
comme le précise BaseView.hx :

"templo doesnt manage optional params in functions"

Neko compile la fonction à 2 arguments ; Templo l'appelle avec 1 → crash.

Solution

  • View.hDate revient à 1 argument, sans paramètre optionnel
  • Les 5 appels view.hDate(date, true) dans Cron.hx et VolunteerService.hx
    utilisent directement Formatting.hDate(date, true)

Test

  1. Admin → Distributions → plus d'Invalid call
  2. ContractAdmin → Commandes → plus d'Invalid call
  3. Vérifier qu'un email bénévole contient la date avec l'année

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

… Templo

Templo ne supporte pas les paramètres optionnels dans les appels de fonctions
(cf. commentaire BaseView : "templo doesnt manage optional params in functions").
Le commit bdbbd8d avait ajouté ?year:Bool=false à View.hDate, ce qui
compilait la fonction Neko en 2 arguments. Les templates l'appelant avec
1 argument déclenchaient une "Invalid call" sur les pages Distributions et
ContractAdmin/selectDistrib.

Solution : View.hDate revient à 1 argument ; les appels avec year=true
(Cron.hx, VolunteerService.hx) passent directement par Formatting.hDate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@InterAMAP44 InterAMAP44 merged commit 049915f into staging Jun 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants