Function phpbb_register_url not found or invalid function name

DesmoGiec
Posts: 4
Joined: Tue Feb 11, 2020 5:47 am

Function phpbb_register_url not found or invalid function name

Post by DesmoGiec »

Hello,
I have logfiles in cpanel full with this error:
PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'phpbb_register_url' not found or invalid function name
I've searched through the code and found this:

in wp-w3all-phpbb-integration, line 722

Code: Select all

 add_filter( 'register_url', 'phpbb_register_url', 10, 1); 
from line 614

Code: Select all

function phpbb_register_url( $register_url ) {
   global $w3all_url_to_cms, $w3all_iframe_phpbb_link_yn, $wp_w3all_forum_folder_wp;
   	
  if( $w3all_iframe_phpbb_link_yn == 1 ){ 
   $wp_w3all_forum_folder_wp = "index.php/" . $wp_w3all_forum_folder_wp;
   $redirect = $wp_w3all_forum_folder_wp . '/?mode=register';
   	return $redirect;
  } else { // register no iframe, direct link to phpBB
     $redirect = $w3all_url_to_cms . '/ucp.php?mode=register';
      return $redirect;
    }

 }
Does this happen to me only or is a known issue?
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Function phpbb_register_url not found or invalid function name

Post by axew3 »

let see!
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Function phpbb_register_url not found or invalid function name

Post by axew3 »

So strange, no never reported nor experienced, nor i can reproduce at moment setting any plugin option in any flavor

It is just the function/filter/hook that rewrite wp registration and Lost pass links to point to phpBB instead then wordpress.
I will try to understand how it is possible that it could come out, that seem impossible (to me) at moment...

You want registration and lost pass to point to phpBB and activated this option?

The plugin's URL setting that need to point to phpBB into the plugin admin, i assume is correctly setup? Because the unique reason that it could return a result like this, is that the URL setting is empty.
DesmoGiec
Posts: 4
Joined: Tue Feb 11, 2020 5:47 am

Re: Function phpbb_register_url not found or invalid function name

Post by DesmoGiec »

Yes, I've enabled the option which redirects registering and lost password to phpbb functions, and I've correctly written the board url in the configuration.

Code: Select all

call_user_func_array() expects parameter 1 to be a valid callback, function 'phpbb_register_url' not found or invalid function name in /home/xxx/public_html/wp-includes/class-wp-hook.php on line 292
I'm using alt-php74, hosted on netsons running on cpanel 92.0.12
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Function phpbb_register_url not found or invalid function name

Post by axew3 »

Sorry my previous assertion, partially wrong, i should read better before to answer, sorry.
The fact that there is no valid callback, mean that the called function is not found.
function phpbb_register_url( $register_url ) {
on wp_w3all.php file.
As said, i tested with any plugin configuration and it is working fine, the function is not wrapped inside something that do not let it to be executed.

Did you changed something into wp_w3all.php file?
If not, it is obscure at moment the reason that it do not work in your case.

You could do this to check, or to resolve:

cut the entire function code:

Code: Select all

 function phpbb_register_url( $register_url ) {
   global $w3all_url_to_cms, $w3all_iframe_phpbb_link_yn, $wp_w3all_forum_folder_wp;
   	
  if( $w3all_iframe_phpbb_link_yn == 1 ){ 
   $wp_w3all_forum_folder_wp = "index.php/" . $wp_w3all_forum_folder_wp;
   $redirect = $wp_w3all_forum_folder_wp . '/?mode=register';
   	return $redirect;
  } else { // register no iframe, direct link to phpBB
     $redirect = $w3all_url_to_cms . '/ucp.php?mode=register';
      return $redirect;
    }

 }
and paste it immediately after the line

Code: Select all

add_filter( 'register_url', 'phpbb_register_url', 10, 1);


I assume it is not a problem that can come out from server, but on how the code is executed.
Very strange.
DesmoGiec
Posts: 4
Joined: Tue Feb 11, 2020 5:47 am

Re: Function phpbb_register_url not found or invalid function name

Post by DesmoGiec »

Well...
Moving the function just after the call.....
Apparently solved the problem :shock:
I'm not sure how that worked, but it worked. :lol:
Post Reply