News:

Join the Facebook Fan Page.

Main Menu

Hide Content

Started by kelvincool, January 03, 2015, 11:08:17 PM

Previous topic - Next topic

kelvincool

Hi, please try v2.3.1 that I have just released, it should resolve this issue.

The cause of this issue is related to how smf sends notifications/alerts, the job that runs the tasks have been moved to cron.php since 2.1.4 (see https://github.com/SimpleMachines/SMF/issues/7696). I loaded my templates in integrate_bbc_codes hook (can't remember why I needed to do this but doesn't seem necessary anymore), the loadTemplate function loads the css and this causes the filemtime(): stat failed error, normally in the code that error is suppressed with the @ sign but because cron.php sets its own error handler the error is no longer suppressed.

@live627 might be interested to know about this issue as it affects his message boxes mod and not @Diego Andrés mod, you posted in the wrong support thread which was quite confusing.

Arantor

loadTemplate probably shouldn't load CSS at all if it's coming from cron.

(Also, the job that runs the tasks long since predates 2.1.4. I added it when it was still 2.1 alpha more than 10 years ago.)
Holder of controversial views, all of which my own.


Lucarella

I installed the update yesterday and, so far, no errors related to the mod, so I can say that the problem has been solved ;)

Thank you

Lucarella

I come back here to understand what's going on with this mod...
After installing the latest version, the SMF error log no longer records any errors, it works fine and I have no problems.
However, I realized in recent days that this mod is generating a lot of errors in the error_log in the FTP directory and the error is the following:
[28-Feb-2024 21:01:38 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to undefined function template_hidecontent_error_wrapper() in /home/ddcrewne/public_html/forum/Sources/HideContent.php:505
Stack traces:
#0 /home/ddcrewne/public_html/forum/Sources/HideContent.php(73): HideContent->evaluateConditions()
#1 /home/ddcrewne/public_html/forum/Sources/Subs.php(3643): HideContent->{closure}()
#2 /home/ddcrewne/public_html/forum/Sources/tasks/CreatePost-Notify.php(561): parse_bbc()
#3 /home/ddcrewne/public_html/forum/Sources/tasks/CreatePost-Notify.php(270): CreatePost_Notify_Background->handleWatchedNotifications()
#4 /home/ddcrewne/public_html/forum/cron.php(249): CreatePost_Notify_Background->execute()
#5 /home/ddcrewne/public_html/forum/cron.php(131): perform_task()
#6 {main}
   thrown in /home/ddcrewne/public_html/forum/Sources/HideContent.php on line 505

This is only the latest one recorded, but there are a lot of them, maybe around 14000, but none in the SMF error log, only in the error_log in FTP.

Should I worry or is it a minor error?

Thank you

kelvincool

@Lucarella I've managed to replicate that, bit surprised they did not go into the smf log but I have released the fix v2.3.2.

Lucarella

Thanks @kelvincool  for your help. Yesterday I installed the new update and the errors stopped, from last night to today none have appeared
The only strange thing I noticed was that immediately after installing the mod, the following errors appeared in the SMF error log:
https://dd-crew.net/forum/cron.php
 /home/ddcrewne/public_html/forum/Sources/Load.php (Linea 2876)

Tipo di errore: Manutenzioni programmate
Messaggio di erroreSeleziona
2: filemtime(): stat failed for /home/ddcrewne/public_html/forum/Themes/Halloween/css/spoiler.css

https://dd-crew.net/forum/cron.php
 /home/ddcrewne/public_html/forum/Sources/Subs.php (Linea 5787) 

Tipo di errore: Manutenzioni programmate
Messaggio di erroreSeleziona
2: SayThanks::integratePreJavascriptOutput(): Argument #1 ($do_deferred) must be passed by reference, value given
I don't know if it's because of this update, but then there weren't any, just these and that's it and related to a single user and both the say thanks and the spoiler function without problems
Maybe a coincidence?

kelvincool

I replicated those errors and they happen when someone exports their profile data, a very rare occurrence so you won't see them very often.

Not sure about the first one but I also got that error and for index.css as well. Seems similar to the earlier css issue.

It looks like the root cause of the second error is an SMF bug in profile export.

All in all I don't think you have to worry about these errors.

Lucarella

In fact I'm not worried, also because I haven't seen them again.

Thank's for your job

Lucarella

Hi kelvincool,
I'm sorry that lately you've been working just for me, but maybe I have a new problem with the hide mod.
As you can see from the image, when you cite a post that contains a non-hidden ed2k link, the ed2k links appear in the citation together with the html tags (which we do not insert with the links) and the link to the file statistics site.


I say that the problem is caused by the hide mod because, to understand what it was, I started uninstalling the mods I have one at a time and, right after removing the hide mod, the problem disappeared and the quotes are perfect.
The mod for ed2k links is this: Ed2k Autolinker
It's not a very big problem, also because quotes with ed2k links inside are not common, so if it can be solved, ok, otherwise never mind...

Thank you

kelvincool

@Lucarella I've been thinking about this problem this past week, unfortunately I think it's a case of the 2 mods do not work well together.

Dorin1

it's just to hide the content, not the attached files


Cola-Coca

I installed the mod successfully.
I want to set that visitors (not registered members) cannot see the hide content while everyone else can. How do I set it up?
I've been trying half an hour.
I LOVE SMF

kelvincool

See screenshot of the option to enable and check as default.

Advertisement: