church_admin_app_new_checkin function – 3 small code changes please.

About Support App church_admin_app_new_checkin function – 3 small code changes please.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11072
    Avatar for Richard HughesRichard Hughes
    Participant

    Premium Version: 5.1.20
    Andy, we love the app. We are very excited to start using the App Check-in feature. Perfect timing for us.

    I am using the app to start get our attendance to go “digital”. But the Check-in option in the app is not creating any records in the DB. There are 3 small bugs in wp-admin.php church_admin_app_new_checkin() function.

    1. wp-admin.php line 4260 and 4264 and 4269 and 4274
    This code below is not executing the query() for me, because CA_DEBUG is not defined.

                                                            
    if(defined('CA_DEBUG') )//church_admin_premium_debug( $sql);
    $wpdb->query( $sql);
    

    I think you are wanting to only execute church_admin_premium_debug() if CA_DEBUG is define. Please update the code to be:

    
    if(defined('CA_DEBUG') ) { church_admin_premium_debug( $sql); }
    $wpdb->query( $sql);   // now this line will always get executed.
    

    2. $people_id is not defined correctly. $what is not defined at all. wp-admin.php line 4241

    
                    foreach( $household AS $key=>$person)
                    {
    
                            if(!empty( $_REQUEST['people'.(int)$people_id] ) )
                            {
                                    //check in $person['people_id] to event
                                    switch( $person['people_type_id'] )
                                            {
                                                    case 1:$which='adults=adults+1'; $v='"1","0"';break;
                                                    case 2:$which='children=children+1'; $v='"0","1"';break;
                                                    default:$which='adults=adults+1'; $v='"1","0"';break;
                                            }
                                          
    

    Needs to be. Notice the 2 small inserted lines of code. @todo

    
                    foreach( $household AS $key=>$person)
                    {
                            $people_id = $person["people_id"]; // @todo - $people_id was set from above, but not with the correct value.
                            if(!empty( $_REQUEST['people'.(int)$people_id] ) )
                            {
                                    //check in $person['people_id] to event
                                    switch( $person['people_type_id'] )
                                            {
                                                    case 1:$which='adults=adults+1'; $v='"1","0"';break;
                                                    case 2:$which='children=children+1'; $v='"0","1"';break;
                                                    default:$which='adults=adults+1'; $v='"1","0"';break;
                                            }
                                            $what = $type;   # @todo - $what was not defined
    
    #11073
    Avatar for Andy MoyleAndy Moyle
    Keymaster

    Will update thanks.

    Modified ever so slightly as you will see.

    • This reply was modified 2 months, 3 weeks ago by Avatar for Andy MoyleAndy Moyle.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.