Missing xForm for cartItem Media #6488
Labels
bug
For issues that describe a defect or regression in the released software
needs triage
For issues that are awaiting triage by the core development team
Projects
Issue Description
There currently is no functionality to resolve cart item images, therefore these are not available in a cart query.
Background
Until v3.5.0 this xform was part of the cart: https://github.com/reactioncommerce/reaction/blob/v3.5.0/src/core-services/cart/xforms/xformCartItems.js
When @aldeed refactored that logic in da6502d that cart xform would only call registered functions of type
xformCartItems
while the actual logic was moved to the files plugin where such a function was registered.So in v3.6.0 we had:
The xform on the cart: https://github.com/reactioncommerce/reaction/blob/v3.6.0/src/core-services/cart/xforms/xformCartItems.js
The actuall functionality here: https://github.com/reactioncommerce/reaction/blob/v3.6.0/src/core-services/files/util/xformItemsAddImageUrls.js
It seems like this got lost when things were moved to separate modules.
api-plugin-carts still contains that same call
context.getFunctionsOfType("xformCartItems")
but the files plugin doesn't register such a function anymore: https://github.com/reactioncommerce/api-plugin-files/blob/8ed90d8901b91940266979906286a09d24aa35b5/src/index.js#L34:L36Looking at the other functions in v3.6.0 I wonder what else might be afffected, as there were 3 other functions aswell and only
startup
is left now:https://github.com/reactioncommerce/reaction/blob/19cd5a6007bd53d73f753d8cd8fd9e941562c849/src/core-services/files/index.js#L36:L42
Steps to Reproduce
imageUrls
returnsnull
.Possible Solution
Register a function of type
xformCartItems
that provides the images.Versions
v1.0.0 - trunk
The text was updated successfully, but these errors were encountered: