Project

General

Profile

Actions

Bug #14576

closed
RM RM

WMenu do sometimes going to the wrong internal path at application startup

Bug #14576: WMenu do sometimes going to the wrong internal path at application startup

Added by Romain Mardulyn 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
06/03/2026
Due date:
% Done:

0%

Estimated time:

Description

When a WMenu has internal path enabled, it sometimes ignore the internal path at application startup and goes to another one.

Here is a way to reproduce the issue:

class Application : public Wt::WApplication
{
public:
  Application(const Wt::WEnvironment& env)
    : Wt::WApplication(env)
  {
    auto stack = root()->addNew<Wt::WStackedWidget>();
    Wt::WMenu* menu = root()->addNew<Wt::WMenu>(stack);
    menu->setInternalPathEnabled("/");

    menu->addItem("dashboard", std::make_unique<Wt::WText>("Dashboard Page"));
    menu->addItem("links", std::make_unique<Wt::WText>("Link Page"));
    auto menuItem = menu->addItem("", std::make_unique<Wt::WText>("Account Settings Page"));
    menuItem->setHidden(true);
    menuItem->setPathComponent("account-settings");
  }
};

Setting the internal path manually using setInternalPath(internalPath(), true) fixes the issue.

RM Updated by Romain Mardulyn 4 months ago Actions #1

  • Status changed from InProgress to Review
  • Assignee deleted (Romain Mardulyn)

MV Updated by Matthias Van Ceulebroeck 3 months ago Actions #2

  • Assignee set to Matthias Van Ceulebroeck

RM Updated by Romain Mardulyn 3 months ago Actions #3

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Matthias Van Ceulebroeck to Romain Mardulyn

RM Updated by Romain Mardulyn 3 months ago Actions #4

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: PDF Atom