- 🇩🇪Germany Anybody Porta Westfalica
@matthiasm11 could you turn this into a MR please for easier review and further progress?
- Merge request !18Issue #3256264 by matthiasm11, anybody: Giftcard transaction reference → (Merged) created by Anybody
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
9 days ago 2:13pm 11 April 2025 If you need to fill up the missing data in hindsight, you can try to get them through the adjustments:
update commerce_giftcard_transaction set reference_type = 'commerce_order', reference_id = ( select coa.entity_id from ((commerce_order__commerce_giftcards cocg left join commerce_order co on (co.order_id = cocg.entity_id)) left join commerce_order__adjustments coa on (coa.entity_id = cocg.entity_id and coa.adjustments_value like '%giftcard%' and coa.adjustments_value like concat('%', cast(trim(amount__number) + 0 as char charset utf8mb4), '%'))) where cocg.commerce_giftcards_target_id = giftcard and coa.entity_id is not null limit 1) where amount__number < 0 and reference_id is null and reference_type is null
Be careful, this is not bulletproof, the join is only on the amount. But this should work in most cases.