VGBC Fase 2 - Sessie Verslag¶
Datum: 2025-12-16 Status: Fase 2 basis voltooid, kritieke issues gevonden
β Bereikt Vandaag¶
1. Conditional Fields - Beroep Velden¶
Probleem: field_beroep_anders en field_student_instelling stonden altijd zichtbaar en verplicht Oplossing: - field_beroep_anders: required=false in field config - Conditional Fields regels opnieuw ingesteld: - Target: field_beroep_anders, Controlled by: field_beroep, Value="anders" - Target: field_student_instelling, Controlled by: field_beroep, Value="student" - Reset target: AAN - Insert value: UIT Status: β WERKT
2. Studentenkorting 40%¶
Probleem: Promotie werkte niet omdat:
- StudentProfessionCondition zocht alleen in "customer" profile
- Gebruikers hebben field_beroep in "openbaar" profile
Oplossing:
- Code aangepast om ALLE user profiles te checken (customer + openbaar)
- Loop door alle profiles, return TRUE bij eerste match met "student"
Code: /web/modules/custom/vg_commerce/src/Plugin/Commerce/Condition/StudentProfessionCondition.php
Status: β
WERKT - 40% korting wordt toegepast
3. VGBC Tickets in Winkel¶
Bereikt: - VGBC 2026 editie (ECK entity vgbc, ID 33) - field_vgbc_editie op vgbc_ticket variations - Beide tickets gekoppeld aan editie 33 - Vignet geΓΌpload en zichtbaar - View winkel_tickets toont tickets met vignet - field_partner toegevoegd aan customer profile (Field Permissions: custom) Status: β Tickets zichtbaar in winkel met vignet
4. VGBC Editie β Ticket Referentie¶
Bereikt: - View "vgbc_editie_producten" aangemaakt - Contextual filter op vgbc editie ID - Block toegevoegd aan vgbc_editie display (Layout Builder) - Toont automatisch gekoppelde tickets per editie Status: β Twee-weg referentie werkt
5. User Account Pagina¶
Bereikt: - View blocks aangemaakt: "Mijn bestellingen" en "Mijn facturen" - Contextual filter: Gebruiker-ID van route-context - Privacy: users zien alleen eigen bestellingen/facturen - Toegevoegd aan user profile via Layout Builder Status: β Werkt, PDF links nog toe te voegen
π΄ KRITIEKE ISSUES¶
1. Mollie Checkout - Database Lock Timeouts¶
Probleem:
- Lock wait timeout op commerce_number_pattern_sequence tabel
- Webhook en return page racen om order te updaten
- Orders blijven hangen in "validation" state
- Users worden uitgelogd na checkout
- Foutmeldingen: "SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded"
Impact: - π¨ HOOG - Users krijgen errors bij checkout - Ongeruste users β veel support telefoontjes - Orders worden niet automatisch voltooid - Facturen worden niet gegenereerd
Huidige situatie: - Patch voor duplicate invoices is geΓ―nstalleerd (commerce_mollie) - Lock timeout: 50 seconden (innodb_lock_wait_timeout) - Probleem blijft bestaan
Mogelijke oplossingen (TO DO): 1. Webhook vs Return race condition: - Mollie webhook en return page updaten order tegelijk - Oplossing: Debounce/queue mechanisme - Of: Skip webhook bij test payments
- Number pattern locking:
- commerce_number_pattern_sequence genereert order/invoice numbers met FOR UPDATE lock
- Oplossing: Pre-generate numbers
-
Of: Gebruik UUID voor order numbers
-
Session timeout:
- Lange wachttijd β session expires β user uitgelogd
- Oplossing: Verhoog session timeout voor checkout
-
Of: Return page re-authenticates user
-
UX verbetering:
- Betere loading state tijdens Mollie return
- "Uw betaling wordt verwerkt" scherm
- Automatische retry bij timeout
- Email bevestiging als fallback
Prioriteit: π₯ KRITIEK voor productie
Next steps: - Notities doorzoeken voor eerdere oplossingen - commerce-setup-overzicht.md: duplicate invoice fix - 20251121-checkout-ux-duplicate-invoices.md: UX improvements
π Kleinere Issues¶
2. Invoice Detail Page - SDC Error¶
Probleem: /user/{uid}/invoices/{id} geeft component error
Foutmelding: InvalidComponentDataException: Unable to render component "navigation:title"
Oorzaak: Drupal 11 SDC (Single Directory Components) + Gin toolbar conflict
Status: Bekend issue, eerder in notities behandeld
Workaround: Link niet naar detail pagina, gebruik PDF download direct
Prioriteit: Laag (PDF download is voldoende)
3. Facturennummering¶
Observatie: Facturen starten bij ID 30, geen oudere facturen in dev database Oorzaak: Dev database refresh of cleanup Impact: Geen - voor productie wordt fresh start gemaakt Actie: Geen, documenteren dat dit normaal is voor dev
π― Fase 2 Status¶
VOLTOOID: - β ECK entities (vgbc_partner_quota, vgbc_editie) - β Custom plugins (StudentProfessionCondition, StandhouderQuotaValidator) - β Product setup (2 tickets, variation type vgbc_ticket) - β Promotie (40% studentenkorting) - β field_partner op customer profile - β Views (winkel_tickets, user orders, user invoices) - β VGBC editie β ticket referentie - β Conditional fields (beroep, student, anders) - β Config export
OPEN: - β Mollie checkout stabiliteit (KRITIEK) - β³ PDF links in facturen view (simpel, via UI) - β³ Testing met echte users - β³ Standhouder quota testen
π Voor Volgende Sessie¶
Prioriteit 1: Mollie Checkout Fix¶
- Notities doorzoeken voor eerdere oplossingen
- Test scenario's reproduceren
- Webhook/return race condition oplossen
- Session management tijdens checkout
- UX improvements (loading states, error handling)
Prioriteit 2: Fase 2 Afronden¶
- PDF download links toevoegen aan facturen view
- Standhouder quota flow testen
- Test checkout met verschillende scenarios
- Documentatie updaten
Prioriteit 3: Fase 3 Voorbereiden¶
- Multi-ticket checkout (Jan koopt voor Marie)
- TicketAssignmentPane checkout pane
- Per-attendee kortingen
- User/profile creatie voor "iemand anders"
π§ Technische Notities¶
Code Changes Today¶
- StudentProfessionCondition.php
- Van: check alleen customer profile
-
Naar: loop door alle profiles (customer + openbaar)
-
field_beroep_anders
-
required: false (was: true)
-
Views contextual filters
- commerce_user_orders: user ID from route context
- commerce_user_invoices: user ID from route context
Config Export¶
GeΓ«xporteerd: - field.field.profile.customer.field_partner - field.storage.commerce_product_variation.field_vgbc_editie - views.view.commerce_user_orders (block display) - views.view.commerce_user_invoices (block display) - views.view.vgbc_editie_producten (new) - Conditional fields config (via UI)π‘ Geleerde Lessen¶
- Profile types verwarrend: field_beroep zit in "openbaar" profile, niet "customer" β code moet beide checken
- Conditional Fields alpha: Stabiel maar config kan verdwijnen β altijd backup/export
- Commerce checkout fragiel: Lock timeouts en race conditions zijn reΓ«el probleem
- Views contextual filters: "User ID from route context" is essentieel voor privacy
- Field Permissions: Custom permissions nodig voor field_partner (alleen admin/redactie/winkel)
Sessie duur: ~4 uur Lines of code: ~50 (aangepast) Config changes: ~15 entities Coffee cups: βββ
UPDATE: Patch Situatie (na middag sessie)¶
Geprobeerd: Beide Drupal.org patches toevoegen¶
Core patch: Issue #3505182 - Navigation:title component crasht met NULL label
Commerce Invoice patch: Issue #3532643 - Label fallback voor draft invoices
Probleem ontdekt¶
Beide patches zijn voor development branches (11.x-dev, 2.x-dev), niet stable releases:
- https://git.drupalcode.org/project/drupal/-/merge_requests/10235.diff β voor 11.x-dev
- https://git.drupalcode.org/project/commerce_invoice/-/merge_requests/11.diff β voor 2.x-dev
Onze installatie: - Drupal core: 11.2.10 (stable) - Commerce Invoice: 2.2.0 (stable)
Result: Patches passen niet, composer error: "No available patcher was able to apply patch"
Oplossing: Workaround zonder patches β ¶
Root cause van beide bugs:
1. Commerce Invoice heeft geen label voor draft/validation invoices (invoice_number is nog NULL)
2. Core Navigation component crasht als entity->label() NULL retourneert
3. Dit gebeurt alleen op de factuur detailpagina (/user/{uid}/invoices/{id})
Workaround:
- Link niet naar detailpagina, maar direct naar PDF download
- View commerce_user_invoices aangepast:
- Row style: Fields (was: Rendered entity)
- Velden: factuurnummer, bedrag, status, PDF download
- PDF link: /print/pdf/commerce_invoice/{invoice_id} (Entity Print module)
- Target: _blank (opent in nieuwe tab)
Voordelen: - β Geen SDC/Navigation bug (detailpagina wordt niet bezocht) - β Direct PDF download (betere UX) - β Geen patches nodig - β Werkt met stable releases
Voor productie: - Als Drupal 11.3.0 of 12.0.0 uitkomt met fix in core β upgrade - Als Commerce Invoice 2.3.0 uitkomt met label fallback β upgrade - Tot die tijd: workaround is solide en production-ready
Composer Patches Status¶
Actieve patches:
{
"drupal/commerce_invoice": {
"Fix file validator for Drupal 10+": "patches/commerce_invoice-file_validator_drupal10.patch"
}
}
Alleen lokale patch voor file validator (werkt wel, is voor Drupal 10+ compatibility).
MR patches verwijderd uit composer.json (pasten niet op stable releases).
Conclusie¶
Patches zijn niet nodig voor productie. Workaround met PDF download is de beste oplossing tot de fixes in stable releases zitten.