Support Forum

Spoiler reveal not working

SP sptab
sptab
Member

Hello,

 

The spoiler features on my forum seems to work corrected as the tags, formatting and content are correctly output to the page HTML when making a new post or editing one.

The problem is the “Reveal Spoiler” link does not do anything and the spoiler does not appear.

You can find one example here

 

Could you please help me to fix this embarrassing problem ?

My WP and SP are latest versions but this problem has existed since months on my setup.

I have tried 3 different SP themes and the problem is still there.

 

Thank you.

19 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Best start with a quick test to see if it is actually working…

[spoiler]Yes it is![/spoiler]

YS Yellow Swordfish
Yellow Swordfish
Member

OK – good so far!

You have one script error on your website – at least on the forum page which may be enough to stop some other scripts from functioning. We really need to eliminate that one before we can delve any deeper just in case…

The actual error message is: Uncaught ReferenceError: OA_show is not defined – in other words it is trying to call a function called OA_show which does not exist.

This is contained in a div with a class name of  ‘td-header-sp-recs’ which is defined between the ‘ARCTABLET NEWS’ head and the menu. Nothing actually displays there, presumably because of that error.

SP sptab
sptab
Member

I have just double checked the site, specifically the web page I linked before and I did not get any error in my Chrome debug console.

Could you check if the page I linked above also shows the problem you reported and let me know which browser / tool / add-on you are using to get this error ?

 

Edit:

About the console error, it was probably my mistake, I have re-tested and found the same error you reported. I removed the code and that error is gone. The spoiler reveal still does not work.

I can also mention I have tested the problem with a simpler WP theme like Twenty Fourteen and reveal spoiler does not work either.

 

Cheers.

YS Yellow Swordfish
Yellow Swordfish
Member

That’s useful. You still have the same error (twice) on the home page of the site. Plus you appear to have also removed the site title from the top!

So – there are no script errors when the button is clicked which fails either. That’s odd.

What version of WP is this and are you able to update to the latest? I see the forum is not up to date…

SP sptab
sptab
Member

As I already mentioned, the blog and forum are on latest versions.

WP is 4.7.1 and SP 5.7.3. 

This reveal not working problem has been there since many months, maybe more than a year.

Also, as I said, the issue does not get solved if I change WP theme or SP theme, even to simpler ones.

As for the diagnostic, I think we should focus on testing a single page such as the one I linked, Checking homepage or other site locations may raise other issues that are out of interest here.

 

How the Reveal Spoiler link is supposed to work exactly ? What can explain nothing happens and no errors are shown ?

 

Thank you.

YS Yellow Swordfish
Yellow Swordfish
Member

Something is amiss because that spoiler reveal on your site is not generating our 5.7.3 HTML but an older version..

SP sptab
sptab
Member

Well, that’s an interesting lead.

How could I check that in more details, which “old” SP version is left in my system ? where would be outdated file located for that spoiler issue ? I suppose that’s in core SP files, not in the plugin or theme area ?

Does each SP update overwrite all the files on each upgrade ? Would there be any risk to correct the outdated files by hand / manually redo a full SP files upgrade ?

Thank you for your help.

YS Yellow Swordfish
Yellow Swordfish
Member

When WordPress updates a plugin it completely replaces it – it does not do it file by file.

If you go to the forum admin > Toolbox > Install Log – what is the very top entry?

SP sptab
sptab
Member

Here is top output:

Version   Build Release Installed By
5.7.3   14754 Release 2016/12/13 admin
Version: 5.7.3
Section: 14754
Status: success
Response: Build upgrade section 14754 executing. Status: success

 

and for the last entry at the bottom I have:

           
4.4.5   6398 Release 2011/10/24 admin
Not Recorded
YS Yellow Swordfish
Yellow Swordfish
Member

Weirder and weirder…

Would you be able to copy one of the SP code files, zip it up and post it here as an attachment so I can compare it because something is not tying up quite right.

If you can then the file to go for is /simple-press/sp-api/sp-api-filters/php…

SP sptab
sptab
Member

Please find here an archive of the whole simple-press plugin directory from the live site.

If you look at the file dates of the archived files, you will see 2 modified files:

– sp-api/sp-api-filters.php

I did make some changes yesterday as a test but I restored the original file. As I wasn’t sure it would be 100% original, I downloaded the original SP package on your site and extracted that single file to its original location on my site. This is current file in place on my site, and the one you see in the archive

– forum/database/sp-db-statistics.php

There is a small change I apply on SP core after each update, to get moderators included in the top poster stats of the site.

 

I can also post the MD5 of all files if needed.

Thank you for your help.

YS Yellow Swordfish
Yellow Swordfish
Member

The one you sent me here is correct but it is still NOT the same code that is creating that div on your site which was updated in either 5.7.2 or 5.7.3. 

This is most disconcerting! And I am totally stumped. Let’s bring my colleague into this to see if he has any ideas.

@mr-papa – If you look here – http://www.arctablet.com/blog/forum/arctablet-website/testing-spoiler-display/ – you will see that the reveal link does nothing. If you inspect the code you will see that the link uses the old style format (before the listener) but without the JavaScript call on the onclick. So no ‘data’ items get defined from the sp_filter_display_spoiler() display function.

I can not replicate this. And everything says the site is using 5.7.3 – and the code behind this IS 5.7.3.

I am out of ideas…

MP Mr Papa
Mr Papa
Member

when you upgraded, did you use the updater? or ftp?  basically, making sure you dont have two simple press folders (one with slight name change) in the plugins folder of WP…

SP sptab
sptab
Member

Hello,

Updates have always been done thru WordPress updater and I have just checked there is just one “simple-press” directory and no similar name in my wp-content/plugins directory.

I have changed line 1952 on file sp-api-filters.php, by changing $out = ”; to $out = ‘….’;
And as you can see this link the change is properly applied on the page (you can see the 4 dots just before the spoiler link)

Which other parts of SP code are responsible to the spoiler link click and spoiler content display ?

I am not sure to clearly understand, I’d really need some help to know the history for the spoiler changes internally in SP and how they relate to my case. What could I manually change in the code to temporary fix the problem, at least until we get a better understanding of the situation ?

 

Thank you.