If you have OpacLangSelectorMode set to "both" the page will have a duplicate id because the same menu include is used in the header and the footer.
Created attachment 185229 [details] [review] Bug 40612: Eliminate duplicate element id in OPAC language menus This patch updates the include file used to display the OPAC language menu in the header and footer. The include already makes use of a "context" variable which tells it whether it's in the header or footer. We can use the same logic to give unique ids for each instance. To test, apply the patch and rebuild the OPAC CSS. - Go to Administration -> System preferences -> OpacLangSelectorMode and set it to "both top and footer." - Go to the OPAC and inspect the HTML for each language menu. The one in the header should have the id "header_langmenu." The one in the footer should have "footer_langmenu." Sponsored-by: Athens County Public Libraries
Created attachment 186229 [details] [review] Bug 40612: Eliminate duplicate element id in OPAC language menus This patch updates the include file used to display the OPAC language menu in the header and footer. The include already makes use of a "context" variable which tells it whether it's in the header or footer. We can use the same logic to give unique ids for each instance. To test, apply the patch and rebuild the OPAC CSS. - Go to Administration -> System preferences -> OpacLangSelectorMode and set it to "both top and footer." - Go to the OPAC and inspect the HTML for each language menu. The one in the header should have the id "header_langmenu." The one in the footer should have "footer_langmenu." Sponsored-by: Athens County Public Libraries Signed-off-by: Ludovic Julien <ludovic.julien@inLibro.com>
Tested and works perfectly, thank you! This patch fixes a subtle but important issue. Having unique element IDs in HTML is not just a matter of clean code — it’s essential for accessibility, JavaScript functionality, and ensuring valid, predictable DOM behavior. Thanks for catching and addressing this! Small changes like this really contribute to a more solid and maintainable OPAC for everyone.
Created attachment 186471 [details] [review] Bug 40612: Eliminate duplicate element id in OPAC language menus This patch updates the include file used to display the OPAC language menu in the header and footer. The include already makes use of a "context" variable which tells it whether it's in the header or footer. We can use the same logic to give unique ids for each instance. To test, apply the patch and rebuild the OPAC CSS. - Go to Administration -> System preferences -> OpacLangSelectorMode and set it to "both top and footer." - Go to the OPAC and inspect the HTML for each language menu. The one in the header should have the id "header_langmenu." The one in the footer should have "footer_langmenu." Sponsored-by: Athens County Public Libraries Signed-off-by: Ludovic Julien <ludovic.julien@inLibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nice work everyone! Pushed to main for 25.11
Nice work everyone! Pushed to 25.05.x