Skip to content

Not possible to override mappingFallback in VSF 1.11 #3822

@juho-jaakkola

Description

@juho-jaakkola

Current behavior

In VSF 1.10 I was able to do this:

In src/modules/index.ts:

import { extendModule } from '@vue-storefront/core/lib/module'
import { urlExtend } from './my-module'

extendModule(urlExtend)

and in my-module:

const extendUrlVuex = {
  actions: {
    async mappingFallback ({ dispatch }, payload: { url: string, params: any}) {
      // Custom check, whether the URL path matches a custom content type.

      return {
        name: 'foo',
        params: {
          slug: 'foo'
        }
      }
    }
  }
}

export const urlExtend = {
  key: 'url',
  store: { modules: [{ key: 'url', module: extendUrlVuex }] },
}

As documented here: https://docs.vuestorefront.io/guide/basics/url.html#how-to-customize-the-mapping-mechanism

However, it seems in 1.11.0 the custom mappingFallback does not get called anymore.

Expected behavior

I should be able to override the default mappingFallback action from my module.

Repository

https://github.com/DivanteLtd/vue-storefront/tree/v1.11.0-rc.2

Can you handle fixing this bug by yourself?

  • YES
  • NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Metadata

Metadata

Labels

questionIf you are not sure how sth works or want discuss someting

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions