Product Support

Participant Log

Adds a dynamic list of entries to each record. Log work hours, attendance records, list your collection, places you've been...adds a whole new dimension to your Participants Database record.

Product Setup

Global Log Configuration

In the Participants Database admin menu will be an item named “Participant Log.” On that page you will find the global settings for all logs under the “General Settings” tab. This is where you set things like the template (which controls the layout) and other general settings for all the logs. These settings can be individually overridden in the log field definition if needed.

Setting up the Log

The first thing to do to set up a log is to add a new “Participant Log” field to the Participants Database on the Manage Database Fields page. This new field is the “container” for the log, and in most ways is simply another field in the database. The General Settings tab of the plugin settings menu provides a way to add a new log. When this field is created, a new table is added to your WordPress database which will hold the data for the log.

It is important that the name of your log should be the name of what is stored in it. If, for example, the log is meant to record a person’s time spent volunteering, you might call it “Volunteer Hours.” If it is storing a record of class attendance, you could call it “Class Attendance” or “Attendance Record.” You can change the title that is displayed once it is set up, but the name of the log field can’t be changed, so it’s worth taking a minute to think about what you call it before committing the name. Once you set up the log field, you can configure what is recorded in each entry of the log you created.

log field structure diagram
Example setup for an attendance log

Configuring the Log

On the Participant Log admin page, you will see a tab for the log you created. Under that tab you can configure the log: you can set the name for an entry or entries which will help the user interface make more sense. There are more settings that determine what the frontend user can do and also how the log will be displayed in various contexts. This will be explained in more detail later.

Configuring Log Entry Fields

Each log can have as many fields as needed to hold whatever information you need to store in each entry. The user interface for that is the same used for managing the fields in the main database. You can add fields, and then configure each field as needed. They work the same as fields in the main database. Each entry field you create for the log adds a column to the log’s database table.

An example of a set of fields defined for a work log.

Field Visibility

Entry fields have a “Visibility” setting that determines the context in which the entry field will be shown. “Public” means the field will be shown in all contexts. “Private” means the field will only be shown to the owner of the record and administrators. “Admin” means the field will be visible to administrators only.

Searchable Fields

When list searching is enabled, only fields that are both visible and marked as searchable will be used to get search results. This is helpful to making searches more efficient and avoids spurious results.

Searchable log entry fields are also available in regular Participants Database list displays so that records with log entries that match the search can be found.

Sortable Fields

Fields that have this setting enabled will be shown in the header of log entry list displays so the log can be sorted by the value of that field.

Field Validation

Entry fields can be made required in the entry field’s configuration. The entry fields use “client side validation” which means the user’s browser will perform the validation and provide the feedback. This is going to look slightly different on every platform, there is little you can do about that, but it has the upside of working on all platforms and devices. To make a field required, you set the validation setting to “required.” You can add to the field validation configuration by using validation attributes.

The Admin Record Log Display

The log display on the record edit page in the admin shows a list of all the entries. The list is paginated, and the number of entries shown on each page of entries is determined in the general settings for the log, in the “Entries Per Page” setting.

The display for the log on the frontend is similar, but what controls are shown depends on the configuration.

Entry List Filtering or  Searching

There is a search input at the top, any text typed into the search input will be used to filter the list of entries. On the admin side, all the visible entry fields are included in the search. On the frontend, only fields marked as “searchable” will be included in the search.

Entry List Sorting

The entries can be sorted by clicking on the blue arrow icons seen in the top bar. The fields that can be used for sorting are configured in the log entry fields configurations: check the “Sortable” checkbox to configure the field to appear in the sorting bar.

Adding Entries

Once you have the entry fields set up, you can begin adding entries to the log. Entries can be added in the admin by going to the admin edit record page for the record you want to add log entries to. Find your log field on the edit record page and in the display for the log field, you will see a button with a plus sign for adding a new entry. Clicking that will bring up a form for entering the data for your log entry. Each entry may also be edited by clicking the pencil icon next to the entry. Clicking the pencil will open a form where the contents of the entry can be changed. Entries can be deleted individually by clicking the red on the entry line. When the “X” is clicked, you will be asked to confirm deleting the entry. There is no undo, deleted entries are gone forever unless you restore it from a backup.

Exporting/Importing Entries

In the admin record edit display (Edit Participant), the entry data for the record’s log can be exported as a CSV file. This works pretty much the same as exporting records from Participants Database: if you have used a filter, the export will only include the entries shown after the filter is applied. Records can also be imported with a CSV file. It’s also possible to import and export data for all records on the Participant Log admin page under the tab for the log.

The Frontend Log Entry Display

In single record and editable record displays on the frontend, the log is displayed as a list of entries. It is very similar to the display in the admin, only the ways that the user can interact with the list are controlled by settings. This is so you can choose whether the log can be added to by users, entries edited, deleted, etc. When the record is displayed using the [pdb_single] shortcode, a list of entries is shown using the template style chosen in the Participant Log settings under the general tab. The entry list in this display can be sorted and filtered. Only log entry fields that have “public” visibility will be shown in this display.

Display Templates

For the frontend displays of the log entry list, 3 basic templates can be chosen. Which one you choose is going to be determined by what you need to show, and what is going to work best for your users.

The Table template will put the log entries into a fixed-width grid so all the values will line up below a header row. This can be the clearest way to show the log entries, but you can only control the width of the table by controlling how many log entry fields you’re showing. Also, it isn’t great on small screens because the width is not determined by the device’s screen width, and so horizontal scrolling is usually required to see all the information.

The Responsive template takes the approach that every log entry field is a separate element with its own width determined by the title and data display. These elements can flow into whatever configuration will fit on the screen. With this template, all the data will be visible on any device, but it can be cluttered.

The Grid template is kindof a bend between the two. It is responsive in that the width of the log display is determined by the width of the device display, but instead of each entry field having its own width, the widths of the entry fields are controlled into columns. This can result in a more organized and easier to see display of the log entry data.

For any kind of responsive display, some adjustments of the CSS that controls the layout are often needed. These additional CSS rules can be placed in the Participants Database Custom CSS setting.

The Summary Display

Each log entry list display may optionally show a “summary” which is configurable to show an important value, such as the number of entries. By choosing a different sum type, the summary can also display other values. If the sum type is a numeric field, the summary will be a sum of the entry values for that field, such as for a work log that shows the number of hours worked. If the field is not a numeric field, the summary will show the number of records that contain a value for that field or if the field has a default value, the sum will show all the fields that have a value different from the default value.

When searches are performed on the list or when a date range is selected, the sum value is immediately updated to show the correct value. This also happens when entries are added, deleted or edited.

This sum value is also saved in the main database so that in Participants Database list displays, the list can be sorted by the summary value: for example you could rank volunteers according to the number of hours logged, or place the collector’s club member with the largest collection at the top.

Showing an Interactive Log Entry List

When the editable record is displayed using the [pdb_record] shortcode, the log entry display is sortable and filterable, but it is also possible to enable adding new entries, editing and deleting entries, and also import and/or export entries using a CSV file. The settings that control access to these features are in the Participant Log settings, under the General Settings tab. The user interactions in this display are very similar to what is possible in the admin. Log entry fields that have a visibility setting of “public” or “private” will be seen in this display.

Frontend Imports and Exports

The interactive log list display can also be configured to allow the user to import and/or export data to a record’s log. This is enabled under the global settings for the [pdb_record] log display.

Global Log Displays

It’s possible to display a list of log entries that are taken from all the log entries in all records. There is a special shortcode [pdb_log_list] that will show all the entries in the same way that the Participants Database list shortcode shows a list of Participants Database records. You can use shortcode filters, custom templates, search, sort, etc. to customize the display.

An example of the use of this shortcode would be a car club, where each member keeps a list of the cars in their collection. The global log display could be used to show all the cars in the club.

If you’ve got more than one Participant Log defined, you can tell the shortcode which one to use with the log_name attribute. Just give that attribute the name of your log, and it will show entries from that log.

Product Settings

General Settings

These settings will affect all logs, but it is possible to override them for a specific log in the participant log field definition attributes setting.

Enable Log Search: when checked, a search input will be shown above the display of log entries. This search input will search on visible fields only.

Enable Log Sorting: when checked, fields that are configured as “sortable” will show as sorting links in the header of the log entry list.

Enable Date Created Sorting: the “Date Created” field is an automatically set timestamp for every entry. This switch allows the user to sort the entries by this timestamp field.

Entries Per Page: sets the default number of entries to show in the list. If there are more entries in the log than this number, a pagination control will be shown.

Record Shortcode Settings

These are settings that pertain to showing the log list when using the [pdb_record] shortcode. The log list in this context is editable.

Record Shortcode Log Template: select the display template to use when showing the log entry list.

Enable Creating New Entries: when checked, allow the user to add entries.

Enable Editing Entries: allows the user to edit entries.

Enable Deleting Entries: allows the user to delete entries.

Allow Log Export: allows the user to export a CSV with the log entry data.

Allow Log Import: allows the user to import log entries in a CSV file.

“Slide In” Entry Controls: when checked, the log edit controls will be hidden until the user hovers over an entry. This is good for compact displays.

Highlight Color: lets you select the color to use when highlighting an entry while it is added or edited.

Single Shortcode Settings

These setting are used when showing the list of log entries when using the [pdb_single] shortcode.

Single Shortcode Log Template: selects the display template to use when showing the log entry list.

Individual Log Settings

For each log you have defined, there is a tab and under that tab are settings that are specific to that log.

Tabs for individual logs: “Work Log” and “Projects Completed”

Log Fields

In this section, the fields that are used for each entry of a log are defined. The interface is very similar to the one used on the Manage Database Fields page. There are a few differences, for example, there are no field groups (instead there is a “visibility” selector). And, like the Manage Database Fields interface, which options you can set depend on the type of field you have created. You can edit, delete and add log entry fields in this interface.

It is highly recommended that you define all the fields you need to use before adding entries to the log.

An example of a set of fields defined for a work log.
Configuring a log entry field

Log Options

For each log, a set of options is available:

Log Entry Name: name for a single entry.

Log Entry Name Plural: name for several entries.

No Entries Message: message to show when a log has no entries.

Search Field Placeholder: when the search input is shown, this placeholder string will serve as a prompt for the user.

Entry Image Height: the nominal image height for images uploaded to a log entry. The aspect ratio will be preserved in most cases.

Entry Dates

These settings are for configuring how entries are dated.

Primary Date Field: this allows you to select a log entry field to use as the date for the entry. It defaults to the timestamp that is set when the entry is created. You would use this in the case of something like a list of events where the date of the event is more important than the date the entry was created. This date field will be used to sort the entries chronologically.

Show Log Entry Timestamp: every entry has a timestamp, this preference lets you make that timestamp visible.

Timestamp Title: if you are showing the timestamp, this is how it will be labeled.

Date Range Filter

It is possible to filter entries by date range, these settings configure the date range interface.

Enable the Date Range Filter: check this to turn on the date range control for the log.

Date Range Filter Heading Text: title for the date range control. Leave blank for no title.

Date Range Filter Button Text: text for the button that performs the date range filtering.

Entry Sum Display

The “entry sum” is a feature of the log where a configurable sum is shown. The default is to show the number of entries, but if there is a numeric field in the log entries, the entry sum can show a sum of those values. For example, in a work log, it can show the number of hours worked.

Show Entry Sum in Record Displays: this is to enable a summary display just above the list of entries.

Sum Type: this is where you would configure what is summed.

Sum Display Template: this gives you a way to control how the sum is displayed. There are a number of “value tags” you can use to show dynamic values from the log in the summary display.

F.A.Q.

Is it possible to override the global setting in individual logs?

Yes, this happens in the log field definition on the Manage Database Fields page in the main plugin. You add your override to the “attributes” for example to override the global setting and allow adding entries on the frontend:

allow_frontend_add::true

Here is a list of the global settings with the proper name to use in the attribute:

Setting attribute name
Enable Log Search enable_log_search
Enable Log Sorting enable_log_sorting
Entries Per Page entry_list_limit
Record Shortcode Log Template record_module_log_template
Enable Creating New Entries allow_frontend_add
Enable Editing Entries allow_frontend_edit
Enable Deleting Entries allow_frontend_delete
Allow Log Export allow_export
Allow Log Import allow_import
“Slide In” Entry Controls hide_entry_controls
Highlight Color highlight_color
Single Shortcode Log Template single_module_log_template
How can I show a customized sum of values for the log list?

Each log has a “summary display” that can be used to show a simple sum from the log data. If you want to show a sum that is specific to your application, such as a sum that is conditional, or a sum that involves multiple entry fields, you need some custom code for that.

In technical terms, the code you need is a filter handler that takes the normal value that would be displayed and changes it ro a custom calculated value. This is best added as a custom plugin or you can put it into your theme functions.php file.

The filter hook is pdblog-{$logname}_sum where {$logname} is the slug name of the log field. You’ll see that on the manage database fields page where the log field is defined.

The filter gets two arguments: the configured sum value (in other words, what the sum would show if you didn’t change it) and the second argument is an array of the record’s log values. You can calculate your sum from the values in that array, and then the filter handler should return your new sum, which will be displayed with the log as configured in the log’s settings for the summary display.

There is a simple example here: https://gist.github.com/xnau/fb961393fc675cf802a509a2a1c888d1

 

Is it possible to provide a link to the editable record in the Global Log List?

The Global Log List shortcode will show a filtered list of entries from all records for a particular log. Each line in the list is an individual entry from a record’s log. It is possible to place a link to the editable record in this list so that the log entry can be edited. This requires the use of a custom template.

Be sure to control access to this list display, you will be giving edit access to your records when you use it.

To use this custom template, you must first create a “placeholder” field in the main Participants Database plugin. You can also re-use an existing placeholder field if you want. Below is a link to the custom template. You must modify it to use the placeholder field you set up.

pdb-log_list-edit-link.php

Is it possible to delete log entries that are no longer connected to a PDB record?

As of version 1.5.9, when a Participants Database record is deleted, the entries belonging to that record are deleted also.

If records were deleted prior to that version, or if records were deleted not using the “with selected” delete method on the List Participants admin page, you can end up with entries that no longer have a parent record.

There is a utility function you can use to clear these out. To do that go to the Participant Log admin page. Add &pdblog-delete-orphan-entries=log_name to the URL and hit return. This will clear out all the entries that are not connected to a PDB record. For example, if your log is named “automobiles” you can clear out the orphan entries from that log with a URL like this:

When creating a field for a new log, I get this error message: “Failed to create table for this log. You need to use a different name for your log.”

The message you’re seeing means that the table needed to create the log could not be created for some reason. The part about trying a different name is just the most likely reason for the failure.

What I suggest you do is start over: on the Manage Database Fields page, delete the log field. It will be a field of type “Participant Log” Once the log field has been deleted, go to the Participant Database settings under the Advanced tab and turn plugin debugging on to “all errors”. Once that’s enabled, open the Debugging Log page and clear the log.

Now, recreate the log: go back to the Participant Log settings page and create a new log. Try using a very simple name for the log at first…you can always change the display name of the log later, but when you’re first creating it it’s a good idea to use something simple. Once you’ve created the new log field, go back to the Participant Log settings and under the tab for the new log, create your first field for the log. If you get the error message again, check the debugging log.

If you can’t create the log field because of the error, post a question to tech support on this page.

Be sure to turn plugin debugging off again once you get things set up and working.

Support Discussions for Participant Log

  • Hi Roland, I got my head around the earlier issue re pdb-log-list, thanks, works fine.

    Also thank you for quick response re: HTML attributes on log entries. A slight hiccup though. Whatever date I choose off the date picker, or entered directly, it gets saved as 1970./01/01 The site is set up for English date format dd/mm/yyyy. The Standard date form element gets saved ok but also appears yyyy/mm/dd, but not a great issue. (if you are trying to promote ISO 8601 I’m all for it!). It all works ok on the main PDB module.

    What I would really, really, like is a pdb-total short code on the log data table… At the moment I am using an SQLplugin to do the job but its not been updated for 4 years :(
    Best wishes

    • Are you using the “strict date format” setting? Probably that should be off. When you use the date picker all it does is place the date string into the input, so if it is placing a date string that can’t be parsed, you get that 1970 date. You need to make sure your site is configured so that it can parse those dates. You’re not mentioning what the date looks like after using the datepicker, just what happens to it after saving.

      • Hi Roland,

        I was using strict date format (set to d/m/Y) as that seems to be what the instructions say (it is a non-American English site. I am in the UK). This agrees with WordPress Settings/General.
        I tried unchecking strict date format and it made no difference. I even logged out and back in again.
        The date picker looks correct when the date is picked.
        The main PDB module saves it correctly.
        The pdb log module saves all HTML5 dates as 1970-01-01
        Regards
        Andrew

        • Try using a regular date field, not the HTML5 Date field. Let me know if that works any better. The HTML5 Date field is a new feature for the Participant Log plugin, there may be issues I’m not aware of there.

  • Hi Roland, I am following in the trail of Laura… Despite defining log_list I had to use the full log field name to get the link to appear.
    // EDIT THIS to match the name of the field you want to use for your edit lnk
    $link_field = 'subspaid_curr_yr_flag';

    And, like Laura, opening the link gave no pid so got 'No Record was Found' message. Although this is her original problem rather than the wrong pid

    Although the template refers to Record Count display_count=true does not work

    I am using the new log_list template
    Here is the full code:
    [pdb_log_list template=edit-link display_count=true log_name=subspaid fields="subspaid_curr_yr_flag,subspaid_pay_method,subspaid_date_paid,subspaid_subs_paid,subspaid_prepaid_cy,subspaid_memo_ref"]
    Thanks

    • You need to use a field from the main plugin for your link field, then include it in the “fields” list.

      To display the count, look at the “Entry Sum Display” setting, for the log, the sum display must be configured and enabled.

  • Is it possible to move the ‘Add log entry’ button to the top of the log? I am using a standard pdb_record template so I’m not sure what template needs to be changed?
    Thanks

    • Possible, but not easily done. This hasn’t been set up with a customizable template, the only way to rearrange the components of the log display is to use some custom code that reorders the array of display elements. If you want to delve into that, I can give you some pointers on how to write that code.

  • Hello Roland!
    I have a question, i hope it’s not beyond the scope of using this plugin.
    I am forced to use wordpress with your Participants database plugin and it’s extensions offline. By offline I mean without the Internet connection.
    It’s working so far, but the problem is speed: a certain script (a part of PDB Log) is doing cloudflare.cdnjs checking and it’s slowing my site drastically.
    I tried blocking all http requests with ´define( ‘WP_HTTP_BLOCK_EXTERNAL’, TRUE ); ´ but it’s not working, the cloudflare checkup is executing still.
    Is there a solution for this.
    If it’s not in the scope of this plugin extension, please give me some general advice or point me in the right direction regarding this problem.
    Thank you in advance.

    • Yes, I’m sorry about this, it’s not uncommon for WordPress plugins to depend on an internet connection to load external assets from a CDN, such as what you’re seeing there. There are probably a lot more than just that one. I’d have to do a pretty extensive re-write to avoid this, so I’m not sure what to recommend other than suggest that you alter the core files to load those assets locally.

      • Hello Roland!
        I’m still having problems with this CDN loading script.
        I know this is a bit the scope of using this plugin, but any help will be greatly appreciated.
        Could you please suggest which core files to alter and how, or at least some further reading on that subject.
        I tried loading local scripts, but the plugin pops out CSV uploading dialog.
        This plugin add-on is awesome and I really need the feature that it provides. It would be great to have the possibility to use it offline.
        I tried using ‘airplane mode’ plugin that speeds up the site locally, but this add-on doesn’t work with it.
        Again, ANY help will be greatly appreciated.
        Thanks in advance.

        • 1. Open your browser developer tools to the network panel, then load some pages with Participants Database.
          2. Make a note of all the failed calls to remote servers
          3. Get online, then download all the assets that are loaded remotely and add them to the plugin
          4. Find the places in the plugin where those remote assets are loaded
          5. replace the remote address with the local path. You can see how to do that by looking at other assets the plugin loads locally

          Keep a copy of your modifications to the plugin on your local machine. When you need to update Participants Database, you can merge your changes with the new version.

  • Hi,
    The date field (a field I added but set as a date field type and as the primary date field in the log settings) used to default to the current date, but no longer does (since the update I think).

    I have put current_date as the default value but it’s still empty.
    Thanks

    • Thanks for the report, I’ll have to take a look at this, the default value for a date field should be working, this is code that changed recently. You can expect an update to fix this in the next week or so.

  • RE: https://wordpress.org/support/topic/help-with-participant-log-sum-function/#post-14460564

    For decades I’ve built and maintained numerous Access databases for nonprofit organizations but I can’t figure out yours.

    • OK, so can you describe what it is you need it to do?

      • I have 23 numeric “ranking” fields in the Participant Log, from ranking_1 to ranking_23, some of which have an input and others that mostly won’t, that I want to sum/total for my users.

        • OK, you will need to write a custom function for that. You will need to be familiar with writing a WordPress filter handler, which is a piece of code that gives you a way to change a value used by the core code without altering the core code. In this case, you will be generating the sum value for a record’s log entries.

          The filter hook is pdblog-{$logname}_sum where {$logname} is the slug name of the log field. You’ll see that on the manage database fields page where the log field is defined.

          The filter gets two arguments: the configured sum value (in other words, what the sum would show if you didn’t change it) and the second argument is an array of the record’s log values. You can calculate your sum from the values in that array, and then the filter handler should return your new sum, which will be displayed with the log as configured in the log’s settings for the summary display.

          There is a simple example here: https://gist.github.com/xnau/fb961393fc675cf802a509a2a1c888d1

  • When using a Multiselect checkbox and setting Validation to Required, it requires all of the checkboxes to be ticked, not just one of them. Is there a way to require only one box to be chosen?

    The help text also doesn’t appear in the pop up form, is there a setting to make it visible?
    Thanks

    • Hi Laura,

      I’m not seeing this problem in my tests. How do you have your multiselect checkbox field validation configured?

      Help text is not in a popup, it is usually displayed just under the group of checkboxes.

      Can you send me a link to your form so I can take a look?

      • I just chose Required from the dropdown, there wasn’t any other configuration that I could see.

        Re the help text I meant the form is a pop up, its the form to add/edit a log entry. There’s nothing appearing under the options.

        I can’t give a link as the whole is password protected I’m afraid.

        • I see…I did not realize you were looking at the log entry editor. I confirmed there is an issue with the validation, I will need to issue an update to fix this, should be out in a couple of days.

        • That’s great, thank you.

        • The update is great thanks, the only thing is that when you edit a log entry, you have to click one of the required checkboxes again, even if one is already selected. A small thing, but just thought I’d let you know.

          Thanks

        • OK, thanks, I didn’t notice that. I’ll get a fix out for that, it’s annoying.

  • I have been trying to get the pdb-log_list-edit-link.php code you provided to work.
    I am using it exactly as provided, and have set the Participant Record Page correctly.

    The correct page opens, but there is no id (private or record) being inserted to the end of the url.

    I have made several templates for pdb_list, opening different edit pages using the record_id, but I just can’t get it to work for a log, so decided to use the inbuilt Participant Record Page setting for this log, but it’s not working I’m afraid.

    It would be really great to get this working.
    Thanks

    • It is necessary to have the “log_name” attribute in the log_list shortcode.

      • Yes, the log_name is already specified in the log_list shortcode.

        • Hi Laura,

          OK, it turns out the template needed to be updated. I suggest you download the latest version and use that one.

          https://gist.github.com/xnau/9579c48af664cccbf150a92d40655b18

        • Yes, I have been using the placeholder edit_link field from the main plugin, all the way through..

        • If the code still isn’t working for you, then I have not identified the specific problem you are having. I was able to duplicate it when attempting to use a log entry field instead of a main plugin field for the link field, so I was pretty sure that was it. Other than that, I do not see this problem in my tests, and so I can only guess what’s going on in your case.

          So to make sure we are all talking about the same code, I’d like to verify that you are using the latest version of Participants Database (at least 1.9.7.4) Participant Log (1.4.12) and the currently posted version of the log list link template.

    • I just issued an update to the Participant Log plugin (1.4.8) that will fix the issue you’re seeing with the log list.

      • Thanks, the global_log_list is now appearing correctly :-)
        The new template returns a private id to the url, thank you, but it is not the right one. It’s actually leading to the same incorrect record that was showing before you fixed the global_log_list.

        • Did you update the template? I posted a link to an updated log list edit link template.

          https://gist.github.com/xnau/9579c48af664cccbf150a92d40655b18

        • [pdb_log_list template=edit-link log_name="debt" fields="date_recorded, edit_link, debt_added_by, patient_name, last_name, debt_action_taken, debt_client_communication, debt_type_of_action, debt_initials, debt_deadline" orderby="debt_deadline, last_name" order="asc" filter="debt_action_completed="]

        • OK, still trying to figure out why this isn’t working in your case. It would be helpful to see the query that is getting used to generate the list. Turn plugin debugging on (Participants Database settings under the advanced tab) then go to the debugging log and clear it. Load the page with the issue, then get the query that shows up in the log, thanks.

      • Yes, I updated the template and as I said, it does now return a private id, it’s just the wrong one.

        • I’m not sure what is going wrong there. There was a bug that was linking the log entries to the incorrect record, which I addressed, so I don’t know of any remaining problems to look at here. What is the complete shortcode you are using for your list?

        • Debugging log:

          “PDb_List::_setup_iteration list query: SELECT p.id, pdb.id AS pdbid, p.date_recorded, pdb.edit_link, p.debt_added_by, pdb.patient_name, pdb.last_name, p.debt_action_taken, p.debt_client_communication, p.debt_type_of_action, p.debt_initials, p.debt_deadline FROM wpxf_participants_database_debt p JOIN wpxf_participants_database pdb ON pdb.id = p.record_id WHERE (p.debt_action_completed IS NULL OR p.debt_action_completed = “”) ORDER BY p.debt_deadline ASC, pdb.last_name ASC”

        • Hi,

          Just wondered if you’d had a chance to look at this?

          The template was updated, and the shortcode is:
          [pdb_log_list template=edit-link log_name="debt" fields="date_recorded, edit_link, debt_added_by, patient_name, last_name, debt_action_taken, debt_client_communication, debt_type_of_action, debt_initials, debt_deadline" orderby="debt_deadline, last_name" order="asc" filter="debt_action_completed="]

          and the query from the debugging log is:
          “PDb_List::_setup_iteration list query: SELECT p.id, pdb.id AS pdbid, p.date_recorded, pdb.edit_link, p.debt_added_by, pdb.patient_name, pdb.last_name, p.debt_action_taken, p.debt_client_communication, p.debt_type_of_action, p.debt_initials, p.debt_deadline FROM wpxf_participants_database_debt p JOIN wpxf_participants_database pdb ON pdb.id = p.record_id WHERE (p.debt_action_completed IS NULL OR p.debt_action_completed = “”) ORDER BY p.debt_deadline ASC, pdb.last_name ASC”

          The edit link is still returning the wrong private id.

          Thanks

        • So…all the private IDs are incorrect, or just on some of them? Trying to get a sense of exactly what could be going on there, as this is working as expected in my tests. Do you notice some pattern as far as how the private ID is incorrect? For instance is it offset (showing the private ID of the previous record for example) or seems random?

        • There’s no pattern that I can see, and every one I’ve tried is wrong, a few even have no id on the link at all.

        • OK, well you can see in the pdb-log_list-edit-link.php template at the top there is a function where the link to the record is acquired, and it’s pretty straightforward, nothing there that would lead to an incorrect private ID.

          This makes me think there is some kind of caching going on where stale results are returned.

          You can monitor the process by adding an error_log statement to the function to see what value is acquired. This will tell you if it is the query that is not right, or if the results of the query are correct, some kind of issue with the display of the list itself. For example:

          function xnau_get_entry_record_edit_link( $record_id )
          {
            global $wpdb;
            $private_id = $wpdb->get_var( 'SELECT private_id FROM ' . Participants_Db::$participants_table . ' WHERE id = "' . $record_id . '" LIMIT 1' );
            
            error_log(__FUNCTION__.' for record id ' . $record_id . ' got private id: ' . $private_id );
          
            return Participants_Db::get_record_link( $private_id );
          }
        • I added the error log, and it gives:

          “[06/24/21 10:03am UTC]
          PDb_Participant_Cache::get getting participant id 140 failed”

          There are 7 different id numbers and they are all repeated 10 times.
          When checking on the admin list, those records do not exist.

        • OK, I’m going to have to investigate this further.

        • I updated the log list template, it will get the correct edit link more reliably now.

          https://gist.github.com/xnau/9579c48af664cccbf150a92d40655b18

        • Thanks, I used the new template, but I’m afraid there’s no change. Still linking to the wrong ids and the debuggng log is still giving the same errors.

        • I discovered that you need to be using a field from the main plugin for your edit link field. I was doing that, so it worked for me, but I did not realize it would make a difference. I suggest you create a “placeholder” field in the main plugin for this purpose.

        • I was on the most up to date plugins, but since your last message updates have appeared, I updated and it works!
          Must have been a delay in the updates appearing, but thank you so much for fixing this, it makes a huge difference :-)

        • Glad to hear it, thanks for letting me know.

  • Is it possible to filter the log entries shown on pdb_record?
    The normal filter attribute doesn’t seem to have any effect on the log fields.
    I would normally do this with a global list but I still haven’t been able to get an edit link working.

    I have so many things I want to use this plugin for (as it’s so useful), I’ve been using different logs for different purposes, as they all require very different fields, with little crossover.

    Thanks

    • No, there is no filtering available on the log lists. You can show them or not, but you can’t control which entries are shown in the shortcode like you can with the [pdb_list] shortcode.

      • Ok, thanks. If I could get the edit link on the global list working it would solve a lot of issues (assuming the recent issue can be fixed of course).

        Thanks for an amazing plugin, it really is so incredibly useful.

  • Hi Roland,
    I want to migrate my website to a fresh WP installation and I would like to export all the Pdb config, can I do it with sql?
    By config I mean :
    1. All the groups and fields in the pdb normal table
    2. All the fields/options in the pdb log tables
    3. All the config from the installed pdb plugins

Got a Support Question?

You have to agree to the comment policy.

Would you like to be notified of followup comments via e-mail? You can also subscribe without commenting.