On latest marketplace, setting a brand Image will make the whole cleint ui unusable.
The console throws: TypeError: Cannot read property 'getShop' of undefined
The error seems to be in this part of /core/ui/client/containers/navbar.js: (L21-24)
if (shop && Array.isArray(shop.brandAssets)) {
const brandAsset = _.find(this.getShop().brandAssets, (asset) => asset.type === "navbarBrandImage");
brandMedia = Media.findOne(brandAsset.mediaId);
}
the getShop()function doesn't exist anymore in navbar.js.
this.getShop() can simply be replaced with shop, as there is a var "shop" defined now, which will have the same value that getShop() returned.
@janus-reith we tried to reproduce on the marketplace as of today.. couldn't. If you can, can you add steps to reproduce?
Weird, will try to clone the repo again and try without modifications - Although there were no New commits changing that file.
In imports/plugins/core/ui-navbar/client/containers/navbar.js there is the line const brandAsset = _.find(this.getShop().brandAssets, [...]
getShop is nowhere defined in that file.
@janus-reith can you confirm that #3030 resolves this?
Yes, the PR does exactly what I described in the first comment. Closing this as it's fixed :)
Most helpful comment
Yes, the PR does exactly what I described in the first comment. Closing this as it's fixed :)