question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HarmonyMenu: Javascript exception while restoring state

See original GitHub issue

Describe the bug

I’m using Harmony theme 3.0.1 which was performing fine on Primefaces 11.0.4. But since I upgraded to Primefaces 11.0.6 I encounter JavaScript Errors on page load while the menu tries to resore it’s state from the cookie “harmony_expandeditems”. As a result the active menu entry is not highlighted and expanded submenus are not expanded anymore after page reload/switch. I also tested Primefaces 11.0.8 which produces the same error.

This error appears in JavaScript console in browser:

12:19:51.144 Uncaught Error: Syntax error, unrecognized expression: #mainmenuform\:MainMenu__40f8676d-e2f9-4de1-8c5e-66d82e2b02ba|1
    jQuery 7
    restoreMenuState http://localhost:8080/webapp/javax.faces.resource/js/layout.js.faces?ln=harmony-layout:337
    init http://localhost:8080/webapp/javax.faces.resource/js/layout.js.faces?ln=harmony-layout:36
    Class.extend/e[d]< http://localhost:8080/webapp/javax.faces.resource/core.js.faces?ln=primefaces&v=11.0.6&e=11.0.6:24
    c http://localhost:8080/webapp/javax.faces.resource/core.js.faces?ln=primefaces&v=11.0.6&e=11.0.6:24
    createWidget http://localhost:8080/webapp/javax.faces.resource/core.js.faces?ln=primefaces&v=11.0.6&e=11.0.6:18
    cw http://localhost:8080/webapp/javax.faces.resource/core.js.faces?ln=primefaces&v=11.0.6&e=11.0.6:18
    <anonymous> http://localhost:8080/webapp/portal/home.faces:97
jquery.js.faces:2:13639

This seems to be the same issue as 9143 which states that the pipe character in the elemets id needs to be escaped, but it affects primefaces 11 versions from version 11.0.6 onwards.

Reproducer

No response

Expected behavior

On page reload/switch the active menu entries should be highlighted.

PrimeFaces edition

Elite

PrimeFaces version

11.0.8

Theme

Harmony

JSF implementation

Mojarra

JSF version

Mojarra 2.2.13.SP5

Java version

OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)

Browser(s)

Firefox 102.3.0esr (64-Bit)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, Oct 12, 2022

See the issue and why it was changed: https://github.com/primefaces/primefaces/issues/8443

PR: https://github.com/primefaces/primefaces/pull/8446

You basically need PrimeTek to update the Harmony template for 12.0.0

0reactions
mellowarecommented, Sep 27, 2022

Yeah it looks like its just a problem with that 11.0.X elite release with the Premium Templates.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PanelMenu: Javascript exception if stateful enabled #9143
panelMenu with statful enabled throws javascript exception : "Uncaught ... HarmonyMenu: Javascript exception while restoring state #9241.
Read more >
SQL Server Database Stuck in Restoring State
In this article we will show reasons why a SQL Server database is in a restoring state and how you can get access...
Read more >
SQL Server: Database stuck in "Restoring" state - Stack Overflow
When I ran this, I got an error message saying that the database was already fully recovered. But it still showed as being...
Read more >
How to solve if SQL database struck in Restoring state
During one such operation, I have observed that the Database was struck in Restoring state. And no SQL operations were working on the...
Read more >
Error restoring state from URL when Opening Dashboards
Hello, Since I updated from 6.8.0 to 7.16,3 always get this error " Error restoring state from URL Unable to completely restore the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found