|
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:
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?
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
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 $mailer->add_content('REG_CONTENT5');
REPLACE WITH $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 $mailer->add_content('REGN_CONTENT1');
REPLACE WITH $mailer->add_content('REGN_CONTENT1', null);
also in scripts/adduser.inc.php FIND NEAR LINE 803 $mailer->add_content('REGN_CONTENT3');
REPLACE WITH $mailer->add_content('REGN_CONTENT3', null);
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
Fix applied, all fine
|
|
|
|
Joined: Jun 2006
Posts: 956
Old Hand
|
Old Hand
Joined: Jun 2006
Posts: 956 |
Stop, got another one Now I receive the email and click the verify link: 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
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
Dang it. lol Thanks - Fixed! in scripts/verifyemail.inc.php FIND NEAR LINE 94 $mailer->add_content('REGN_CONTENT1');
REPLACE WITH $mailer->add_content('REGN_CONTENT1', null);
also in scripts/verifyemail.inc.php FIND NEAR LINE 97 $mailer->add_content('REGN_CONTENT3');
REPLACE WITH $mailer->add_content('REGN_CONTENT3', null);
Well, lets just get them all while we're at it. in scripts/delete.inc.php FIND NEAR LINE 55 $mailer->add_content('DMP_CONTENT');
REPLACE WITH $mailer->add_content('DMP_CONTENT', null);
in scripts/domailthread.inc.php FIND NEAR LINE 176 $mailer->add_content('DMP_CONTENT');
REPLACE WITH $mailer->add_content('DMP_CONTENT', null);
Now I believe we're all caught up. 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
|
|
|
|
Joined: Jul 2006
Posts: 116 Likes: 4
Member
|
Member
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 . For example, Apache NetBeans 10 is a pretty good and have full PHP 7.3 support: https://netbeans.apache.org/download/nb100/nb100.htmlI just imported UBB into my NetBeans installation and it shows immediately an error in cache_builders/calendar.php line 4: $output_text = "<table border="0"><tr><th>{$ubbt_lang['CALENDAR']}</th><tr><tr></td></tr></table>"; what should be: $output_text = "<table border=\"0\"><tr><th>{$ubbt_lang['CALENDAR']}</th><tr><tr></td></tr></table>";
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
Whole night? Greping every file? There are IDEs out there that can do the same task in 5 minutes . 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 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.
|
|
|
|
Joined: Jul 2006
Posts: 116 Likes: 4
Member
|
Member
Joined: Jul 2006
Posts: 116 Likes: 4 |
Please try to not be so condescending in every post you write. Sorry, that was not my intention . 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
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
Sorry, that was not my intention . I thought you are using a regular editor and just wanted to point out that there are much better alternatives out there. thank you
|
|
|
|
Joined: Oct 2007
Posts: 361 Likes: 8
Enthusiast
|
Enthusiast
Joined: Oct 2007
Posts: 361 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?
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
Newest PHP now, apply the code of fixes above, enjoy.
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
1 members (Ruben),
1,248
guests, and
268
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|