Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
I try to register a new user for testing my board and email content. After I fill out the form and final submit it I get this error:

Code
Fatal error: Uncaught ArgumentCountError: Too few arguments to function mailer::add_content(), 1 passed in /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/scripts/adduser.inc.php on line 762 and at least 2 expected in /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/libs/mailer.inc.php:139 Stack trace: #0 /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/scripts/adduser.inc.php(762): mailer->add_content('REG_CONTENT5') #1 /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/ubbthreads.php(279): page_adduser_run() #2 {main} thrown in /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/libs/mailer.inc.php on line 139

The user was created and I can see him the control panel. The verify email was not send out.
At this point I can press F5 and get back the forum with the info that the user now already exists.
The error musst have something to do with creating the register email.
Mail a user in the control panel and sent out notifys to users works well.

More informations:
I try this while using stock englisch language files
Server ist running php5.6 but I setup a .htaccess file for the ubb.threads directory to run the forum with php7.2.11
Forum is not using any hacks.
I setup the register queue to verify any new user (need approval)
I use StopForumSpam

As I can see there was a modification in line 757 of adduser.inc.php in V7.7.1 (append a ,null). Can cause this the error? Something missing?


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
There is a known Stack Trace error in UBB.threads 7.7.0 and 7.7.1 when running PHP 7.1 (or newer). The Stack Trace errors will not occur if you are using PHP 5.4 through PHP 7.0.

This has been patched for UBB.threads 7.7.2, set to be released in March 2019.

The error only occurs when your forum is set to require admin approval for new user registrations. And only occurs at the time of sending the "Your account needs to be approved by an Administrator before you can log in. You will receive an email once this has been done" email. The account is still created and can be activated by an admin, except the registering user sees an error page, and does not receive that notification email.

That patch consists of correcting 1 line in 1 file, which is:

in scripts/adduser.inc.php
FIND NEAR LINE 762
PHP Code
$mailer->add_content('REG_CONTENT5'); 
REPLACE WITH
PHP Code
$mailer->add_content('REG_CONTENT5', null); 
--

Within that same file there are 2 additional lines to patch, which are semi-related to your reported bug. They patch a possible Stack Trace error regarding the "Notify me when a new user registers on the forum" notifications. ie, the "There is no approval required, but you have chosen to be notified of all new user registrations" email which is sent to admins which request it. This is also a PHP 7.1 (or newer) issue.

Those two lines are:

also in scripts/adduser.inc.php
FIND NEAR LINE 800
PHP Code
$mailer->add_content('REGN_CONTENT1'); 
REPLACE WITH
PHP Code
$mailer->add_content('REGN_CONTENT1', null); 

also in scripts/adduser.inc.php
FIND NEAR LINE 803
PHP Code
$mailer->add_content('REGN_CONTENT3'); 
REPLACE WITH
PHP Code
$mailer->add_content('REGN_CONTENT3', null); 


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
Fix applied, all fine thumbsup


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Jun 2006
Posts: 956
Old Hand
Old Hand
Joined: Jun 2006
Posts: 956
Stop, got another one smile
Now I receive the email and click the verify link:

Code
Fatal error: Uncaught ArgumentCountError: Too few arguments to function mailer::add_content(), 1 passed in /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/scripts/verifyemail.inc.php on line 94 and at least 2 expected in /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/libs/mailer.inc.php:139 Stack trace: #0 /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/scripts/verifyemail.inc.php(94): mailer->add_content('REGN_CONTENT1') #1 /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/ubbthreads.php(279): page_verifyemail_run() #2 {main} thrown in /kunden/166911_12355/rp-hosting/1020/1020/websites/dragonclan-forum.de/board/libs/mailer.inc.php on line 139 
Maybe the same problem with missing ,null ...

Regards
Zarzal


my board: http://www.dragonclan-forum.de
my hobby: http://www.biker-reise.de
Ich kann bei Fragen zu UBBthreads in Deutsch weiterhelfen oder es zumindest versuchen
Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
Dang it. lol

Thanks - Fixed!

in scripts/verifyemail.inc.php
FIND NEAR LINE 94
PHP Code
$mailer->add_content('REGN_CONTENT1'); 
REPLACE WITH
PHP Code
$mailer->add_content('REGN_CONTENT1', null); 

also in scripts/verifyemail.inc.php
FIND NEAR LINE 97
PHP Code
$mailer->add_content('REGN_CONTENT3'); 
REPLACE WITH
PHP Code
$mailer->add_content('REGN_CONTENT3', null); 


Well, lets just get them all while we're at it. thumbsup

in scripts/delete.inc.php
FIND NEAR LINE 55
PHP Code
$mailer->add_content('DMP_CONTENT'); 
REPLACE WITH
PHP Code
$mailer->add_content('DMP_CONTENT', null); 

in scripts/domailthread.inc.php
FIND NEAR LINE 176
PHP Code
$mailer->add_content('DMP_CONTENT'); 
REPLACE WITH
PHP Code
$mailer->add_content('DMP_CONTENT', null); 

Now I believe we're all caught up. laugh

I absolutely remember spending a whole night on this a few weeks ago. Greping every file for the calls to the $mailer function. Then double-checking all of them. Its just strange to be presented with more of these "add_content" function missing-parameter fixes. But here we are. So tonight, I have gone through and greped for them all. Twice again.

--

NOTES:
"Previously [PHP 7.0 and older], a warning would be emitted for invoking user-defined functions with too few arguments. Now [with PHP 7.1 and newer], this warning has been promoted to an Error exception."
SOURCE: http://php.net/manual/en/migration71.incompatible.php


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jul 2006
Posts: 116
Likes: 4
P
Member
Member
P Offline
Joined: Jul 2006
Posts: 116
Likes: 4
Whole night? Greping every file? There are IDEs out there that can do the same task in 5 minutes wink. For example, Apache NetBeans 10 is a pretty good and have full PHP 7.3 support: https://netbeans.apache.org/download/nb100/nb100.html

I just imported UBB into my NetBeans installation and it shows immediately an error in cache_builders/calendar.php line 4:
Code
$output_text = "<table border="0"><tr><th>{$ubbt_lang['CALENDAR']}</th><tr><tr></td></tr></table>";
what should be:
Code
$output_text = "<table border=\"0\"><tr><th>{$ubbt_lang['CALENDAR']}</th><tr><tr></td></tr></table>";

Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
Originally Posted by Philipp
Whole night? Greping every file? There are IDEs out there that can do the same task in 5 minutes wink.

Yes. A whole night. There were a lot of changes required in order to get the 10-year-old mailer script up to speed with PHP 7.1+ and all the other related script files which use it.

Please try to not be so condescending in every post you write. Be courteous to others. We are a team here. A team with the common goal of making the software better. Better for everyone.

We are aware of using IDEs. Feel free to look at the code from within UBB.threads 7.7.0 (and newer) to see that we have switched from the past ways of multiple formatting styles, to using a single common coding layout presentation. JetBrains IDE is what we are currently using, as of about 4 months ago (October 2018). Prior to that, the previous devs, and myself coded most of it by hand (which is incredibly impressive). Because of that, minor things such as this, did slip through. But as you're seeing, those few items are being caught now thumbsup UBB.threads is a specialized software using many programing language technologies, PHP, HTML, CSS, JavaScript, and Smarty templates.

I'm happy to use all of the tools available. Searching for a single string within 1,000+ files at a time is something I've been doing since the mid 80s, back when things were a bit different. It still works today for things beyond programming.

Working on this software is an enjoyable hobby for me. I do not get paid for my time or my work.


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Jul 2006
Posts: 116
Likes: 4
P
Member
Member
P Offline
Joined: Jul 2006
Posts: 116
Likes: 4
Originally Posted by isaac
Please try to not be so condescending in every post you write.
Sorry, that was not my intention frown. I thought you are using a regular editor and just wanted to point out that there are much better alternatives out there.

Joined: Apr 2004
Posts: 1,945
Likes: 145
UBB.threads Developer
UBB.threads Developer
Joined: Apr 2004
Posts: 1,945
Likes: 145
Originally Posted by Philipp
Sorry, that was not my intention frown. I thought you are using a regular editor and just wanted to point out that there are much better alternatives out there.

thank you thumbsup


Current developer of UBB.threads PHP Forum Software
Current Release: UBBT 7.7.5 // Preview: UBBT 8.0.0
isaac @ id242.com // my forum @ CelicaHobby.com
Joined: Oct 2007
Posts: 354
Likes: 8
Enthusiast
Enthusiast
Joined: Oct 2007
Posts: 354
Likes: 8
I'm planning the upgrade to 7.7.1 and PHP 7*. Should I remain at PHP7.0 until 7.7.2 is released? Or just wait for the March release of 7.7.2 and go straight to PHP7.3? (That's now the default in FreeBSD.) What do you recommend?


The Stovebolt Geek
https://www.stovebolt.com/ubbthreads/ubbthreads.php

Server Information
UBB.threads Version 7.7.5
Release 20201027
Server OS Linux
Server Load 0.16
Web Server Apache/2.4.6
PHP Version 7.4.33
MYSQL Version 5.7.43
Database Size 1.85 GB
Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
Newest PHP now, apply the code of fixes above, enjoy.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
2 members (Havenofsobriety, rootman), 624 guests, and 106 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)