Skip to content

Don't add "Previous version" when mapped_page is to a versionless book #1260

@colleenmcginnis

Description

@colleenmcginnis
Contributor

Describe the bug

For mapped_pages that link to versionless AsciiDoc books (paths set to undefined in legacy-url-mappings.yml), we should not add a "Previous versions" link because it just redirects back to the v3 page.

Example: https://www.elastic.co/docs/deploy-manage/users-roles

Image

Expected behavior

The "Previous version" should be grayed out.

Steps to reproduce

  1. Go to https://www.elastic.co/docs/deploy-manage/users-roles
  2. Open the version dropdown.
  3. Click "Previous version".
  4. You will be redirected to the same page you started on.

Tooling

  • docs-builder
    migration tooling
    I'm not sure

Activity

reakaleek

reakaleek commented on May 15, 2025

@reakaleek
Member

@cotti can we just remove every entry with undefined as value?

Would that have the desired outcome?

cotti

cotti commented on May 23, 2025

@cotti
Contributor

@cotti can we just remove every entry with undefined as value?

Would that have the desired outcome?

Nope, we need a minor adjustment on the mapping logic. If we don't find a viable mapping, we are still yielding a LegacyPageMapping with empty values there rather than null. Skimming through its usage here, seems safe to just allow it to return null. The method's signature already predicts it anyway, and it's the return in case we don't have a list of mapped pages in the first place.

bmorelli25

bmorelli25 commented on Jul 11, 2025

@bmorelli25
Member

This is fixed. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @cotti@bmorelli25@colleenmcginnis@reakaleek

        Issue actions

          Don't add "Previous version" when mapped_page is to a versionless book · Issue #1260 · elastic/docs-builder