Error opening Help/Settings window

I migrated my project from CUBA Platform 6.10 to 7.0.5 and now I get an error when click on Help/Settings menu item:
IllegalArgumentException: Multiple entries with same value: Menu Item 1 caption=project$SomeEntity.browse and Menu Item 2 caption=project$SomeEntity.browse
I found that the exception is raised when setting an options map for a defaultScreen lookup field and the reason of the exception is that some menu items have identical screen ids.
In CUBA 6.x theese screens were opened with it’s own parameters. Does the CUBA Platform 7 require unique screen ids in main menu now? Should I create different screens for every menu item?

Hello @evgenypopov

Menu items should have unique ids, but they can have the same screes.

Could you share how these items are declared in your menu config?

Regards,
Daniil

Here is a fragment of web-menu.xml containing conflicting items:

<item id="myOpenRequest"
      openType="NEW_TAB"
      screen="project$Request.browse">
    <param name="openMode"
           value="myOpenRequest"/>
</item>
<item id="myCloseRequest"
      openType="NEW_TAB"
      screen="project$Request.browse">
    <param name="openMode"
           value="myCloseRequest"/>
</item>

In CUBA 7 “default screen” field is initialized in the same way as in CUBA 6.10 so I suggest that both these items have the same caption, am I right?

No, they have different captions. In Russian “Мои открытые заявки” and “Мои закрытые заявки”
See the full error log in attachment.
error.txt (5.6 KB)

Unfortunately not in the same way. Now CUBA uses the ImmutableBiMap class that requires unique both keys and values.

Great, thank you. It’s clear now.

Problem is that “default screen” functionality doesn’t consider case when both “id” and “screen” are defined - it always uses only “screen” attribute value. That’s why “duplication” error occurs.

In CUBA 6 it works due to inner component mechanisms changed in CUBA 7.

I’ve created an issue: GitHub.

Regards,
Daniil

1 Like

We got same problem after migration on 7.0.4. After updating platform on version 7.0.7 error disappeared.

Now it works fine!

A post was split to a new topic: Problem in report edit screen