• Hello, I recently installed the Participants Database plugin, edited some database fields, and attempted to import a csv file but got a critical error message where the button to upload the file should be. The site is otherwise working fine, and I seem to be able to input data into the fields manually, though I can’t upload a file. Please help! Pertinent information is as follows:

    WordPress version 5.5.1
    Participants Database (version 1.9.6.5) PHP version 7.3.10

    Error Details
    =============
    An error of type E_ERROR was caused in line 175 of the file /var/www/academic_sustainability/wp-content/plugins/participants-database/upload_csv.php. Error message: Uncaught Error: Call to a member function title() on null in /var/www/academic_sustainability/wp-content/plugins/participants-database/upload_csv.php:175
    Stack trace:
    #0 /var/www/academic_sustainability/wp-content/plugins/participants-database/participants-database.php(800): include()
    #1 /var/www/academic_sustainability/wp-includes/class-wp-hook.php(287): Participants_Db::include_admin_file(”)
    #2 /var/www/academic_sustainability/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #3 /var/www/academic_sustainability/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #4 /var/www/academic_sustainability/wp-admin/admin.php(259): do_action(‘participants-da…’)
    #5 {main}
    thrown

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Roland Barker

    (@xnau)

    Check the “Duplicate Record Check Field” setting on the Upload CSV page, make sure it selects an existing field.

    Thread Starter sarahtest

    (@sarahtest)

    Yes, it selects the First name field, which I did not alter.

    Plugin Author Roland Barker

    (@xnau)

    OK, try something different like the email field. Another thing to try is to change the “Duplicate Record Check Field” in the plugin settings under the Signup Form tab.

    We need to make sure that the field in that setting is a valid field, there is an invalid value in there now.

    Thread Starter sarahtest

    (@sarahtest)

    This is what it looks like. I changed the field to “last name” in the Signup form settings, but it still shows up as “first name” in the upload csv window. Changing it within the csv window does not change anything.

    
    Upload the .csv file
    
    Enclosure character
    Auto
     Delimiter character
    Auto
    
    Duplicate Record Preference: 
    Create a new record with the submission
    
    Duplicate Record Check Field: 
    First Name (first_name)
    
    Note: Depending on the "Duplicate Record Preference" setting, imported records are checked against existing records by the field set in the "Duplicate Record Check Field" setting. If a record matching an existing record is imported, one of three things can happen, based on the "Duplicate Record Preference" setting:
    
    Current Setting:
    There has been a critical error on your website. Please check your site admin email inbox for instructions.
    
    Learn more about debugging in WordPress.
    
    Plugin Author Roland Barker

    (@xnau)

    OK, I see what the problem is…there is an invalid field in the stored export options. To fix this, you will need to access the database directly to reset the stored value.

    Open your database in phpMyAdmin (usually found in your hosting control panel) and go to the wp_options table. You’re looking for an entry named “pdb-csv_import_params” Delete that entry and you’ll be good.

    This is something I need to fix in the main plugin, but I won’t be issuing a release that fixes it for at least a week, so this will get you up and running right away.

    Plugin Author Roland Barker

    (@xnau)

    Another, perhaps easier, way to solve this is to add the field in the “Duplicate Record Check Field” setting back to the plugin with the exact same name. Then go back to the CSV import page and set a new preference that points to a field you don’t want to delete. Once you do a CSV upload again, the preference will be set and you can go back and delete the unneeded field.

    Thread Starter sarahtest

    (@sarahtest)

    My campus OIT says that “phpMyAdmin will not work for this because the MySQL server is only visible on the local host.” Do you have some SQL that they can execute at the MySQL command line to do what you are saying to do?

    With regard to your second suggestion, I don’t think I can do this either. The “duplicate record check field” is set to first name, as it has been since I installed the plugin, and I CAN’T do a csv upload at all, which is what prompted me to write.

    Plugin Author Roland Barker

    (@xnau)

    You can send them this query, but I can’t guarantee it will work because I don’t know the configuration of your database.

    DELETE FROM wp_options WHERE option_name = "pdb-csv_import_params"

    If they can’t do that for you, the second suggestion you can definitely do. Go to the Manage Database Fields page, create a new field named “First Name” and then got back to the Import CSV page. It will work now. Once you set the match field to a new field that you are not going to delete, the try an upload, you’ll be set and you can go back and delete the “First Name” field again.

    • This reply was modified 5 years, 8 months ago by Roland Barker.
    Thread Starter sarahtest

    (@sarahtest)

    Thank you for all the help. The “critical error” message is gone now, but when I try to upload a csv I get the following message:
    “There was an error uploading the file. This could be a problem with permissions on the uploads directory.”
    Any ideas?

    Plugin Author Roland Barker

    (@xnau)

    In the plugin settings, the “File Upload Location” is the path to the uploads directory. You should check on the permissions for that directory. If you don’t know how to do that or what the permissions should be, ask tour web host. These settings are specific to your hosting server, I can’t tell you what they should be.

    It’s possible permissions is not the real issue, ask your web host for help with that, it is probably some kind of configuration issue with the server.

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

The topic ‘Critical error, can’t import csv file’ is closed to new replies.