We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36509
    • 127 Posts
    After the upgrade to 2.6.5, my mobile menu stopped working. When you click on it, it does nothing. You can see it here. The code is below. Can you see why this would stop working after the upgrade?

    Thanks

    <div class="hidden-md hidden-lg  menuwrap quabg ">
    		<div class="col-md-6">
    			<a class="mdx_logo" href="[[++site_url]]">
    			<img src="[[++Logo_mobile_image]]" alt="logo"/>
    			</a>
    		</div>
    		
    		<div class="col-md-6">		
    			<input type="checkbox" id="nav-trigger" class="nav-trigger" />
    			<label for="nav-trigger" onclick="showhide()"></label>
    			
    				
    		
    				[[pdoMenu?
    					&parents=`0`
    					&parentRowTpl=`@INLINE <li class="innerrow"><a href="[[+wf.link]]">[[+wf.linktext]]</a>[[+wf.description]]  [[+wf.wrapper]]</li>`
    					&rowTpl=`@INLINE <li [[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>`
    					&outerTpl=`@INLINE<ul class="navigation" id="first-ul" style="display:none;*display:none;">[[+wf.wrapper]]</ul>
    					<script>function showhide(){var e=document.getElementById("first-ul");e.style.display="none"==e.style.display?"block":"none"}</script>`
    					&tplInner=`@INLINE 
    					<input type="checkbox" id="nav-trigger-arr[[+id]]" class="nav-trigger-arr[[+id]]" />
    					<label for="nav-trigger-arr[[+id]]"  onclick="showhide[[+id]]()" class=""></label>
    					<style>
    							  .nav-trigger-arr[[+id]] + label{transition:left .2s; display:block;*display:block}
    							  .nav-trigger-arr[[+id]] {position:absolute;clip: rect(0,0,0,0);}
    							  .nav-trigger-arr[[+id]]:checked ~ .innerul {height:auto;display:block;*display:block}							 
    							  .nav-trigger-arr[[+id]]:checked + label {right: 15px;}
    							  label[for="nav-trigger-arr[[+id]]"]:before{
    									content: "";
    									float: right;
    									font-family: FontAwesome;
    									font-size: 17px;
    								}
    							 label[for="nav-trigger-arr[[+id]]"] {position: absolute;right: 15px;margin-top:-32px;z-index: 9999;cursor: pointer;width: 32px;height: 32px;background-repeat:no-repeat; }
    					</style>
    						
    						<script>
    							function showhide[[+id]](){var e=document.getElementById("sm-ul[[+id]]");e.style.display="none"==e.style.display?"block":"none"}
    						</script>
    
    
    						<ul class="innerul" id="sm-ul[[+id]]" style="display:none;*display:none;">
    							[[+wf.wrapper]]
    						</ul>`
    			]]
    		</div>
    </div>	
      www.JBMWebDesign.com
      www.JBMAutomation.com
      • 17301
      • 932 Posts
      It's an issue with your javascript. showhide() is not defined anywhere.
        ■ email: [email protected] | ■ website: https://alienbuild.uk

        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
        • 36509
        • 127 Posts
        How would I fix this? This was a purchased template and the seller will not respond. Thanks

        Quote from: lkfranklin at Dec 04, 2018, 04:56 PM
        It's an issue with your javascript. showhide() is not defined anywhere.

          www.JBMWebDesign.com
          www.JBMAutomation.com
          • 36509
          • 127 Posts
          Also, why would it have worked before the upgrade?

          Quote from: lkfranklin at Dec 04, 2018, 04:56 PM
          It's an issue with your javascript. showhide() is not defined anywhere.
            www.JBMWebDesign.com
            www.JBMAutomation.com
            • 36509
            • 127 Posts
            Isn't this the code that define's it?

            <script>
                                        function showhide[[+id]](){var e=document.getElementById("sm-ul[[+id]]");e.style.display="none"==e.style.display?"block":"none"}
                                    </script>


            Quote from: lkfranklin at Dec 04, 2018, 04:56 PM
            It's an issue with your javascript. showhide() is not defined anywhere.
              www.JBMWebDesign.com
              www.JBMAutomation.com
              • 38783
              • 571 Posts
              What version of MODX were you upgrading from?

              Had your site been hacked prior to the upgrade?

              Attached is a screen shot of the errors that are being generated when your page is being accessed.

              If no other changes were made to the site other than the upgrade then it may help to do the following, if you have not already:


              • Ensure that all Extras are also upgraded
              • Check the file and folder permissions are correct (probably 755 for folders and 644 for files - with the exception of the config file which should be 400)
              • Delete the contents of the /core/cache/ folder
              • Check the version of PHP that is running on the server and that it is compatible with MODX 2.6.5 and all the extras installed

              On a separate note it might be worth considering making the site a little more secure by following the guidelines here. Since the pre 2.6.5 hacks this has become very relevant: https://docs.modx.com/revolution/2.x/administering-your-site/security/hardening-modx-revolution
                If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                email: [email protected] | website: https://andytough.com
                • 36509
                • 127 Posts
                found the issue, it was with the script calls

                Changed
                <script>function showhide(){var e=document.getElementById("first-ul");e.style.display="none"==e.style.display?"block":"none"}</script>


                to

                <script>
                						function showhide() {
                							var e = document.getElementById("first-ul");
                							if (e.style.display === "none") {
                								e.style.display = "block";
                							} else {
                								e.style.display = "none";
                							}
                						}
                
                					</script>


                and

                <script>
                                            function showhide[[+id]](){var e=document.getElementById("sm-ul[[+id]]");e.style.display="none"==e.style.display?"block":"none"}
                                        </script>


                to

                <script>
                							function showhide[[+id]]() {
                							var e = document.getElementById("sm-ul[[+id]]");
                							if (e.style.display === "none") {
                								e.style.display = "block";
                							} else {
                								e.style.display = "none";
                							}
                						}
                						
                						</script>


                And now it is working.
                  www.JBMWebDesign.com
                  www.JBMAutomation.com
                  • 36509
                  • 127 Posts
                  Quote from: andytough at Dec 04, 2018, 07:09 PM
                  What version of MODX were you upgrading from?

                  Had your site been hacked prior to the upgrade?


                  Not that I am aware of



                  Attached is a screen shot of the errors that are being generated when your page is being accessed.


                  How did you find these? And what do I need to do to fix them?



                  If no other changes were made to the site other than the upgrade then it may help to do the following, if you have not already:


                  • Ensure that all Extras are also upgraded
                  • Check the file and folder permissions are correct (probably 755 for folders and 644 for files - with the exception of the config file which should be 400)
                  • Delete the contents of the /core/cache/ folder
                  • Check the version of PHP that is running on the server and that it is compatible with MODX 2.6.5 and all the extras installed


                  yep did all that.

                    www.JBMWebDesign.com
                    www.JBMAutomation.com
                    • 46886
                    • 1,154 Posts
                    How did you find these? And what do I need to do to fix them?

                    you can use the developer's tools of your browser in firefox or chrome or really any browser to see them. just load the page and watch the console

                    they don't look serious if the problem is fixed its probably ok