Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter reubenbrown13

    (@reubenbrown13)

    @saltalib

    Since you are not getting any records, I would suggest checking the data in your database if possible by using the modified queries, but replacing the php variables with the appropriate values that match up with your database setup and achievements. This way you can confirm the data is there and connected properly. If you get records from that, then it could be an issue with the wpdb setting or something else with the values being passed in.

    Thread Starter reubenbrown13

    (@reubenbrown13)

    Well, after a bit of digging, I found the BUG in the code. The achievement-reports.php has some bad references to tables that don’t exist when using the report on a Multi-Site setup. Also the search string was not correct in the query. Below is the corrected code in case anyone else needs it.

    $sql = "
    SELECT     achievement.ID as ID,
    				 achievement.post_title as title,
    				 (
    						 SELECT     COUNT(DISTINCT post.ID)
    						 FROM       $wpdb->postmeta as meta
    						 INNER JOIN $wpdb->posts as post
    												ON post.ID = meta.post_id
    									 INNER JOIN $wpdb->users as user
    															ON post.post_author = user.ID
    									 LEFT JOIN ".$wpdb->base_prefix."bp_groups_members AS groups_members
    														ON groups_members.user_id = user.ID
    									 LEFT JOIN ".$wpdb->base_prefix."bp_groups AS groups
    															ON groups.id = groups_members.group_id
    									 LEFT JOIN  $wpdb->usermeta AS usermeta
    															ON usermeta.user_id = user.ID
    						 WHERE      meta.meta_key = '_badgeos_log_achievement_id'
    												AND meta.meta_value = achievement.ID
    												AND post.post_title LIKE '%%unlocked%%'
    												$group_filter
    															$usermeta_filter
    															$date_range
    				 ) as earned_count,
    				 (
    						 SELECT     post.post_date
    						 FROM       $wpdb->postmeta as meta
    						 INNER JOIN $wpdb->posts as post
    												ON post.ID = meta.post_id
    						 WHERE      meta.meta_key = '_badgeos_log_achievement_id'
    												AND meta.meta_value = achievement.ID
    												AND post.post_title LIKE '%%unlocked%%'
    												$date_range
    						 LIMIT      1
    				 ) as last_earned_date
    FROM       $wpdb->posts as achievement
    WHERE      achievement.post_type = '".$report->achievement->post_name."'";
    
        $report->data = $wpdb->get_results(
            $wpdb->prepare($sql),
            'ARRAY_A'
        );
    Thread Starter reubenbrown13

    (@reubenbrown13)

    It was the WooCommerce plugin itself. I will need to look at the update you released to see if it fixes the problem for me, but for now we are not using WooCommerce so disabling the plugin was an easy fix.

    Thread Starter reubenbrown13

    (@reubenbrown13)

    Well, this is interesting. I found the issue is the Woocommerce plugin. I disabled the plugin and it started to work again.

    Thread Starter reubenbrown13

    (@reubenbrown13)

    I discovered additional information today. If any of the achievements are listed as shown, it will cause this error for the rest of the achievements that depend on it.

    Thread Starter reubenbrown13

    (@reubenbrown13)

    I was able to figure out where the issue is. It is when you have multiple items set as “Show To User”. Once I had it as hidden, the posts show properly. What it looks like is when the Previous or next links are rendered, the achievement_id is updated to one of those values instead of preserving the current value.

    I have not found the section in the code to fix this, but this is the issue and is a bug.

    @geoffgraham: I have just submitted a pull request for this code to be added to the dev branch for consideration

    I am working on pushing my changes to a git repo so they can be pulled in, but one thing that is quite different is that instead of looping over the quantity supplied by the user and creating individual tickets, I have 1 ticket with the number of people attending. All the metrics still update appropriately, but it allows for the needs my customer had to be met so that a user can RSVP for 4 people, but there is just 1 record to maintain. There is the ability to change the quantity by the user on the front end by re-entering their name and email exactly the same as the previous RSVP and just change the number.

    Here is my repo for the changes. This does include the phone number addition.

    I am not quite sure what it would take to change my code back to function like the existing plugin where 1 ticket is minted per RSVP.

    @notfarnow – I need to remove some client specific info and upload to Git. Once I have free time in the next couple days to do so, I will reply to this post w the info.

    @nicosantos : I have the ability to modify a RSVP based on the email address that is entered. I also have the name/email fields pre-filled with the user info of whomever is logged in. The current version that I am working on is merged with the 4.1.2 version you just released, but it does have some custom code for a client that I will need to remove. Once I have it merged into the 4.1.2 code, I will do a pull request.

    If there is another way to manage the RSVPs other than by email address, I am open to suggestions. For this client, they were not charging for the tickets, so there is not a high security issue with being able to change the RSVPs based on email address only.

    This change also doesn’t accept zero as a valid entry, which would cancel the ticket if desired.

    @larshnordli,

    I had the same issue with needing the phone number captured for a RSVP. I forked the plugin and added the field and handlers to the code. I also use Meld to compare the current Tribe version of the plugin to my forked version so I keep updated with the changes.

    To add the phone number you will need to update the rsvp.php in the view and src/Tribe/ folders.

    @mpallbritton. Install WP Mail Bank and you can setup all your WP Mail settings for that site. I am using it for my instance to control the email info for the Tickets plugin.

    I have a similar issue with people doing multiple RSVPs for the same event. I am working on a patch for the code to allow the plugin to update the RSVP for the user if they try to RSVP again instead of adding another RSVP. Having the need to cancel is useful too, so I may need to look into that as well.

    Thread Starter reubenbrown13

    (@reubenbrown13)

    Thanks Brian. I changed it to use : if ( class_exists( ‘Tribe__Tickets__RSVP’ )) and things are good now. Would it be possible to roll up this feature w/in the 2 plugins? I can fork the code and do a pull request.

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