HarmonyMenu: Javascript exception while restoring state
See original GitHub issueDescribe 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:
- Created a year ago
- Comments:5 (4 by maintainers)
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
Yeah it looks like its just a problem with that 11.0.X elite release with the Premium Templates.