• Resolved baillarg

    (@baillarg)


    I followed the instructions found at :
    https://xnau.com/showing-a-persons-age-in-a-record/ and got the new plugin working.

    I can correctly show my participant’s age with a [pdb_list]

    Unfortunately, since I added this plugin, I can no longer add new participant in the back end. I get the following error :

    age lecture seule
    Fatal error: Uncaught exception ‘Exception’ with message ‘DateTime::__construct(): Failed to parse time string (@) at position 0 (@): Unexpected character’ in /home/pick913/public_html/wp-content/plugins/001f3435b4b193260d8b19228e031af9-d68cefcdd8b8d39a7d2695d54c48e6b5200bc22a/pdb_set_age_value.php:82 Stack trace: #0 /home/pick913/public_html/wp-content/plugins/001f3435b4b193260d8b19228e031af9-d68cefcdd8b8d39a7d2695d54c48e6b5200bc22a/pdb_set_age_value.php(82): DateTime->__construct(‘@’) #1 /home/pick913/public_html/wp-content/plugins/001f3435b4b193260d8b19228e031af9-d68cefcdd8b8d39a7d2695d54c48e6b5200bc22a/pdb_set_age_value.php(48): pdb_set_age_value->get_age(”) #2 /home/pick913/public_html/wp-content/plugins/001f3435b4b193260d8b19228e031af9-d68cefcdd8b8d39a7d2695d54c48e6b5200bc22a/pdb_set_age_value.php(67): pdb_set_age_value->set_age_value_display(”, Object(PDb_FormElement)) #3 [internal function]: pdb_set_age_value->set_age_value(Object(PDb_FormElement)) #4 /home/pick913/public_html/wp-includes/class-wp-hook.php(288): in /home/pick913/public_html/wp-content/plugins/001f3435b4b193260d8b19228e031af9-d68cefcdd8b8d39a7d2695d54c48e6b5200bc22a/pdb_set_age_value.php on line 82

    Fatal error: Call to a member function replace() on null in /home/pick913/public_html/wp-content/plugins/participants-database/vendor/wp-session-manager/includes/DatabaseHandler.php on line 123

    Thank you for your support,

    Jacques

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    So, I’m not sure the exact conditions that lead to this, I can’t duplicate the problem here. What is happening is that the date parser is attempting to parse an empty value in your case for some reason.

    Without knowing what is causing it in the first place (that would be the preferred solution) you can avoid the issue with a small change to the pdb_set_age_value.php file.

    On line 45 of that file, you’ll see:

    if ( isset( $record[ $this->birth_date_field ] ) ) {

    change that so that it will make sure the value is not empty, like this:

    if ( isset( $record[ $this->birth_date_field ] ) && ! empty( $record[ $this->birth_date_field ] ) ) {

    Thread Starter baillarg

    (@baillarg)

    I tried your solution but this killed the access to the web site with an HTTP ERROR 500

    I was fortunate enough to go back to the C-Panel and edit back line 45 to the initial setting and the web site is up again…

    Any alternative?

    I should say that i am using Cloudflare… was there any cache that I should have cleared after editing the plugin?

    Jacques

    Plugin Author xnau webdesign

    (@xnau)

    Just make sure the code you have changed is correct before saving the file. I’ve tested this, there are no errors in what I suggested you do.

    Thread Starter baillarg

    (@baillarg)

    You were right! I did a cut and paste as I did before and this time it works just fine.

    As far as I can see, the only difference for my second attempt is that I deactivated the plugin before editing the php file (which I did not do the first time)

    Anyway… it now works as intended.

    Thank you so much for your support.
    Jacques

    Hello

    I’ve tried to install this plugin, but if fails in the get_age() function on the following line

    $dob = new DateTime("@$birthdate");

    What’s missing for this DateTime class call ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Participants Database Show Participant’s Age’ is closed to new replies.