my client just reported that he clicks on the reply button but nothing happens.
I did some testing and I found that sometimes if I click too quickly onto the "reply" button, there is an "accumulation" of the anchor tags in the URL:
... and nothing happens.
Is there any way to prevent this?
I found that the anchor is not fully reliable. This is such a vital feature. I want to make sure that people always see the editor to write a reply when they click this button.
What do you suggest to make this more "dummy proof"?
It took some real finagling to make this happen... it was hard to hit the button fast enough... but I could see what you were saying because the same happens once the reply form is opened... the anchor fragment gets added... in this case, it doesnt affect anything because you can still save...
but it tells me enough of what is going on, I think... the reply button onclick handler probably needs cleaning up after first action... will investigate...
*update... was able to occasionally get it to happen... and is consistent with my above... users will have to work hard to see this, but certainly possible...
so have a fix... not an easy way to get it to you though... if you are comfortable editing some js code, you can do this:
First, open up your wp-config.php file and add this line of code:
that will let you edit the dev scripts instead of the compressed ones...
then find file simple-press/forum/resources/jscript/sp-forum-dev.js and edit it... around line 146, you find this code:
jQuery('#'+editorId).slideDown(); jQuery('#'+editorId).slideDown(); location.href = location.href + '#spEditFormAnchor'; spjEdOpenEditor(formType);
and then change it to:
jQuery('#'+editorId).slideDown(); jQuery('#'+editorId).slideDown(); if (!window.location.hash) location.href = location.href + '#spEditFormAnchor'; spjEdOpenEditor(formType);
and you should be good to go...
Hi Mr Papa,
thanks for figuring this out.
You may want to consider that loading time plays a vital role in the possible occurrence of the non-functional buttons. If the editor is not fully loaded, it may happen much more easily that the anchor fragment gets added and the reply button is rendered nonfunctional.
But to be honest, I don't understand enough about the whole structure to verify this.
Will your code change be implemented in the next SP updates?
I have also noticed that in case I click the reply button and scroll up to the top of the page, the next click on the button does not take me down to the message editor anymore.
I think the interface could be coded a bit more with such things in mind.
When I remove the #spEditFormAnchor manually from the URL in the browser address bar and I click on the reply button again, it adds "#spEditFormAnchor#spEditFormAnchor" ... and if I do it again, it will add the anchor 3 times. I think it would make sense if you change the coding and make sure the button works in any case and always triggers the jump to the form.
Does that make sense?
Edit: The funny thing is that it works on the new topic form.
Here I can scroll up and click again and the anchor jump works, even though the URL shows the anchor many times already:
I don't understand this
hmm... I cannot replicate the hash fragments growing anymore at all...
did you go to forum - toolbox - housekeeping and clear the combined js cache? and also, I would clear the browser cache too since they hang on to dear life to cache js and css...
I can check and see - probably not too hard to make the add reply scroll to the form - as you say we do that already on the new topic...
yes, all these changes will be in the forthcoming 5.8 release... we are probably a month or two away from that though...
Hi Mr Papa,
I have made the changes to the JS file after changing the wp-config.php.
Am I supposed to change it back when I uploaded the updated JS?
I did that.
I have also cleared the cache, of which I had no idea before you mentioned it.
I am still facing the issue.
You can easily test it by scrolling up again after clicking the reply button and just click onto it again.
How can I find out if the script is actually properly updated on the server?
I found this sp-forum.js but when I open it from the forum source code it is decoded, so I can't really find my updated code. Sorry but this is a bit beyond my knowledge.
No - you need to leave the script switch in the wp-config file as instructed. This ensures that the system uses the non-minimised script files. So turn it back on and then again - clear the js cache.
When the next update comes along you can remove the switch so that the plugin again uses the minimised scripts.
Just tested in IE to see if it may just be a Chrome issue.
The accumulation of anchor tags still happens. At least IE is jumping to the anchor even though it is multiplied in the url after clicking several times.
I can't see that anything changed in the way it functions after making the change to the JS.
And actually i should see this script being used, right:sp-forum-dev.js
but it is still sp-forum.js