Apostrophe workflow using both prefix and locale name in slug

What do you need help with?

Hi there, I’m implementing the Apostrophe workflow component but I am noticing that when creating a new page for a locale, the slug for the page once it is committed is like so: hostname/prefix/locale-name/page-title. Any guidance on why that would be happening?

FWIW, in the editor when I am adding the new page, I see only the prefix but when the page is live, that is when the local name is added.

If I open the page back up again after creation to edit it, I see the slug with both the local name and prefix.

What have you already tried?

Editing the workflow settings in our app.js

What do you have?

My version of the apostrophe module is: 2.107

My version of node is ( node --version ): v10.16.0

My operating system is: Windows

The browser in which I have trouble is: Chrome

Would you share what your Apostrophe Workflow configuration looks like?

Hi Alex - here’s basically how it looks:

'apostrophe-workflow': {
  hostnames: {
    'default': 'localhost',
    'option-one': 'localhost',
    'option-two': 'localhost',
  },
  prefixes: {
    'option-one': '/one',
    'option-two': '/two',
  },
  locales: [
    {
      name: 'default',
      label: 'Default',
      private: true,
      children: [
        {
          name: 'option-one',
          label: 'Option One'
        },
        {
          name: 'option-two',
          label: 'Option Two'
        },
      ]
    }
  ],
  defaultLocale: 'option-one',
  alias: 'workflow'
},

Hmm. You literally get the locale name in the slug, in addition to the prefix you configured for that locale? This doesn’t sound like a behavior we have seen. Can you reproduce it in a simple project that you can share (i.e. a public repo on github)?