Where is addToolbarPopupMenuOption?

AI-generated summary

The discussion revolves around a deprecation notice for addToolbarPopupMenuOptionsCallback, which was incorrectly renamed to addToolbarPopupMenuOption in Discourse’s codebase. pfaffman encountered an error when trying to use the new name, suspecting a bug or documentation issue. david identified the root cause: a typo in the deprecation message and provided a fix via a pull request. Additionally, Don shared that the correct method is actually addComposerToolbarPopupMenuOption, as used in the Composer Footnote Button plugin. pfaffman confirmed the issue was not their fault and appreciated the clarification, noting they’ll now focus on asking better questions about other undocumented or confusing parts. The thread concludes with the issue resolved thanks to community collaboration.

I was using addToolbarPopupMenuOptionsCallback and got a notice it had been renamed to addToolbarPopupMenuOption , but when I did I call addToolbarPopupMenuOption I get a error that it does not exist.


  addToolbarPopupMenuOptionsCallback(opts) {
    deprecated(
      "`addToolbarPopupMenuOptionsCallback` has been renamed to `addToolbarPopupMenuOption`",
      {
        id: "discourse.add-toolbar-popup-menu-options-callback",
        since: "3.2",
        dropFrom: "3.3",
      }
    );

In GitHub - literatecomputing/discourse-qrcode-theme-component: Add QRcode to composer · GitHub

Looks like we have a typo in the deprecation message. Fix here: DEV: Fix toolbar API deprecation message by davidtaylorhq · Pull Request #26266 · discourse/discourse · GitHub

This is the one you want:

I used addComposerToolbarPopupMenuOption when I changed it in Composer Footnote Button.

https://github.com/VaperinaDEV/discourse-composer-footnote-button/commit/dfbe42b42be5e1908a5b0fbf750e2f96ec95b1f3

Aha! So, it’s not just me. That’s great news, as I’ve spent most of the day trying to figure out things that are, in fact, my fault (but might still stand to have some better documentation). I’ll work on asking cogent questions about those things next.

This is resolved. Thanks so much!