Previous Thread
Next Thread
Print Thread
Hop To
V7.7.1: Fatal Error while User registration #262289 02/08/2019 3:01 AM
Joined: Jun 2006
Posts: 956
Zarzal Offline OP
Old Hand
OP Offline
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
Re: V7.7.1: Fatal Error while User registration [Re: Zarzal] #262290 02/08/2019 3:33 AM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
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 // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: V7.7.1: Fatal Error while User registration [Re: Zarzal] #262291 02/08/2019 3:50 AM
Joined: Jun 2006
Posts: 956
Zarzal Offline OP
Old Hand
OP Offline
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
Re: V7.7.1: Fatal Error while User registration [Re: Zarzal] #262292 02/08/2019 4:19 AM
Joined: Jun 2006
Posts: 956
Zarzal Offline OP
Old Hand
OP Offline
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
Re: V7.7.1: Fatal Error while User registration [Re: Zarzal] #262293 02/08/2019 6:19 AM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
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 // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: V7.7.1: Fatal Error while User registration [Re: isaac] #262294 02/09/2019 4:11 AM
Joined: Jul 2006
Posts: 105
Philipp Offline
Member
Offline
Member
Joined: Jul 2006
Posts: 105
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>";

Re: V7.7.1: Fatal Error while User registration [Re: Philipp] #262295 02/09/2019 4:43 AM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
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 // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: V7.7.1: Fatal Error while User registration [Re: isaac] #262296 02/09/2019 5:26 AM
Joined: Jul 2006
Posts: 105
Philipp Offline
Member
Offline
Member
Joined: Jul 2006
Posts: 105
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.

Re: V7.7.1: Fatal Error while User registration [Re: Philipp] #262297 02/09/2019 5:38 AM
Joined: Apr 2004
Posts: 1,549
isaac Offline
UBB.threads Developer
Offline
UBB.threads Developer
Joined: Apr 2004
Posts: 1,549
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 // 7.7.3 released!
isaac @ id242.com // my forum @ CelicaHobby.com
Re: V7.7.1: Fatal Error while User registration [Re: Zarzal] #262298 02/10/2019 2:41 PM
Joined: Oct 2007
Posts: 267
Baldeagle Offline
Enthusiast
Offline
Enthusiast
Joined: Oct 2007
Posts: 267
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

UBBThreads 7.7.3
Web Server Apache/2.4.37
PHP Version 7.2.19
MySQL Version 5.6.38
Database Size 2.23 GB
Re: V7.7.1: Fatal Error while User registration [Re: Zarzal] #262299 02/10/2019 2:43 PM
Joined: Jun 2006
Posts: 15,852
Gizmo Online Tapedshut
UBB.threads Developer
Online Tapedshut
UBB.threads Developer
Joined: Jun 2006
Posts: 15,852
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.
Need to Upgrade?
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!

Forum Search
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Mobile app?
by Baldeagle - 12/06/2019 9:32 PM
How do you change Text Line spacing?
by jorb - 11/23/2019 12:14 AM
What happened to FAQ or Forum Help
by Ruben - 11/20/2019 11:58 AM
Search feature encountering an Error message
by jorb - 11/20/2019 12:06 AM
Followed List v7.7.2 Question
by Ruben - 11/12/2019 12:22 PM
Who's Online Now
3 registered members (Ruben, JAISP, Gizmo), 69 guests, and 379 spiders.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Sky places
Sky places
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20191023)