Fix/rma bugfixes - #44
Merged
Merged
Conversation
added 3 commits
June 27, 2026 08:44
fix: localize RMA lookup labels in form option sources
Collaborator
|
@orilupo puoi aggiornare il file CHANGELOG? Suggerirei la versione 2.4.0 visto che associare il reso all'account se viene fatto da form guest è un'aggiunta. |
SamueleMartini
approved these changes
Jul 8, 2026
This file contains hidden or 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
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.
1. Le RMA da form guest vengono collegate all'account cliente (a41ae1c)
Quando un guest invia una richiesta RMA per un ordine che in realtà appartiene a un cliente registrato, la RMA viene ora associata a quell'account.
In precedenza il controller passava sempre
nullcome customer ID, quindi queste RMA non comparivano mai nell'area riservata del cliente.2. Localizzazione delle label lookup: email, resolver e form (ef7438c)
Le label di status, reason, resolution e condition non venivano tradotte né nelle email transazionali né nelle select del frontend.
Email e resolver:
Service\Email\Senderora avvia la store emulation (area frontend) prima di risolvere le variabili del template, così__()usa il locale dello store view invece di quello admin.Le variabili extra vengono costruite in modo lazy tramite closure, in modo che la risoluzione delle label avvenga dentro il contesto emulato; l'emulation viene sempre chiusa nel blocco
finally, anche in caso di eccezione.Form option source:
AbstractLookupSource::toOptionArray()ora avvolge la label di default dal DB con__(), propagando il fix a tutte le select (reason, resolution type, item condition), sia customer che guest, Luma e Hyvä.Gli override store-specific inseriti dagli admin restano volutamente intatti: sono già nella lingua di destinazione.
Aggiunte le traduzioni delle label seed ai CSV i18n:
de_DE,es_ES,fr_FR,it_IT,ro_RO.3. TypeError in getList() dei repository (bf5449d)
Il TypeError si manifestava in ogni percorso che invoca
getList()dei repository del modulo: comandi CLI (mageos:rma:list,mageos:rma:cleanup), resolver GraphQL, endpoint REST, caricamento di item/commenti e risoluzione degli stati.Tutti gli otto repository dichiaravano return type specifici per entità (
StatusSearchResultsInterface, ecc.), mentre la DI risolveva la classe non tipizzataMagento\Framework\Api\SearchResults, causando unTypeErrora ogni chiamata digetList().Ogni interfaccia ha ora una classe concreta dedicata in
Model/Data/, collegata tramite preference inetc/di.xml.Inizialmente avevo valutato una singola classe concreta che implementasse tutte e otto le interfacce SearchResults (meno boilerplate), ma ho scelto una classe per interfaccia: le preference DI restano auto-documentanti, si rispetta l'Interface Segregation Principle e ogni
getItems()può dichiarare nel docblock il tipo corretto per IDE e analisi statica.