• Resolved vkpsir

    (@vkpsir)


    Hello,

    I’m getting the following error with the current version of Five Star Restaurant Reservations – WordPress Booking Plugin. Would you be able to assist me in addressing the issue?

    PHP Warnings on my error_log file:

    [09-Apr-2022 08:30:56 UTC] PHP Warning:  call_user_func() expects parameter 1 to be a valid callback, no array or string given in /home1/testUser/public_html/wp-content/plugins/restaurant-reservations/includes/template-functions.php on line 224
    [09-Apr-2022 09:04:16 UTC] PHP Warning:  call_user_func() expects parameter 1 to be a valid callback, no array or string given in /home1/testUser/public_html/wp-content/plugins/restaurant-reservations/includes/template-functions.php on line 224
    [09-Apr-2022 09:04:16 UTC] PHP Warning:  call_user_func() expects parameter 1 to be a valid callback, no array or string given in /home1/testUser/public_html/wp-content/plugins/restaurant-reservations/includes/template-functions.php on line 224
    [09-Apr-2022 11:40:33 UTC] PHP Warning:  call_user_func() expects parameter 1 to be a valid callback, no array or string given in /home1/testUser/public_html/wp-content/plugins/restaurant-reservations/includes/template-functions.php on line 224
    [09-Apr-2022 11:40:33 UTC] PHP Warning:  call_user_func() expects parameter 1 to be a valid callback, no array or string given in /home1/testUser/public_html/wp-content/plugins/restaurant-reservations/includes/template-functions.php on line 224

    This is the code I have on Line 224 of my template-functions.php:
    call_user_func( $field[‘callback’], $slug, $field[‘title’], $field[‘request_input’], $callback_args );

    Any suggestions or help would be greatly appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support jaysupport

    (@jaysupport)

    Hello vkpsir,

    Just so we have a better understanding of the situation, could you provide a URL to your page so we can take a look? Hopefully viewing the page would give us a clue of the potential issue. Alternatively, there might be some information in the page source code or dev console that we could make use of.

    Thread Starter vkpsir

    (@vkpsir)

    Hello,

    Here’s what I’ve got in the code:

    <?php foreach( $fields as $fieldset => $contents ) :
    			$fieldset_classes = isset( $contents['callback_args']['classes'] ) ? $contents['callback_args']['classes'] : array();
    			$legend_classes = isset( $contents['callback_args']['legend_classes'] ) ? $contents['callback_args']['legend_classes'] : array();
    		?>
    		<fieldset <?php echo rtb_print_element_class( $fieldset, $fieldset_classes ); ?>>
    
    			<?php if ( !empty( $contents['legend'] ) ) : ?>
    			<legend <?php echo rtb_print_element_class( '', $legend_classes ); ?>>
    				<?php echo $contents['legend']; ?>
    			</legend>
    			<?php endif; ?>
    
    			<?php
    				foreach( $contents['fields'] as $slug => $field ) {
    
    					$callback_args = empty( $field['callback_args'] ) ? array() : $field['callback_args'];
    
    					if ( !empty( $field['required'] ) ) {
    						$callback_args = array_merge( $callback_args, array( 'required' => $field['required'] ) );
    					}
    
    					if ( !empty( $field['empty_option'] ) ) {
    						$callback_args = array_merge( $callback_args, array( 'empty_option' => $field['empty_option'] ) );
    					}
    
    					<strong>call_user_func( $field['callback'], $slug, $field['title'], $field['request_input'], $callback_args );</strong>
    				}
    			?>
    		</fieldset>
    		<?php endforeach; ?>

    The line which has call_user_func is the one where I’m getting an error.
    Please see the following page, although it does not show any error on the console:
    https://jaynepal.lu/booking/

    • This reply was modified 4 years, 1 month ago by vkpsir.
    Plugin Support jaysupport

    (@jaysupport)

    Hi,

    Thanks for the link. I just visited your page and was able to make a booking no problem.

    Are you still having an issue? If so, can you tell me what is not working? Or is everything working and you’re just getting the warning? If that’s the case, did you get the same warnings for the reservation I made?

    Thread Starter vkpsir

    (@vkpsir)

    Yes, there is no error message on the user screen while making a reservation, but the issue is recorded in the error log. Yes, I noticed the same warning for your reservation as well.

    Plugin Support jaysupport

    (@jaysupport)

    Are you using custom fields or fieldsets (modified or newly created)? The reason I ask is because, if you look in the source code of your page, you have an empty fieldset called “message-set” in your booking form. If you are, then please contact us via email or our support center (https://www.fivestarplugins.com/support-center/) as that is part of the premium version, discussion of which is prohibited here (https://ww.wp.xz.cn/support/guidelines/#do-not-post-about-commercial-products).

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Issue: PHP Warning: call_user_func() expects parameter 1 to be a valid callback’ is closed to new replies.