• Resolved eljailer

    (@eljailer)


    Hello,

    I recently encountered an issue with the custom single pdb-tabs template. I have attempted to resolve the problem myself but haven’t received any response yet. Hence, I am reaching out to you for assistance.

    The problem arises when I try to use the custom pdb-tabs template, specifically with the single edit link feature. Upon implementation, I receive the following error message:

    "Warning: Undefined property: stdClass::$fields in G:\wamp64\www...\wp-content\plugins\participants-database\classes\PDb_Template.php on line 622."

    To provide some context, I have included the relevant code snippet responsible for generating the single edit link below:

    <?php// create a template object so we can get the edit link URL$record = new PDb_Template($this);// now output the link using the get_edit_link method?><button class="btn btn-default">    <a id="edit" href="<?php echo $record->get_edit_link() ?>">Edit Record</a></button>

    I have ensured that all my WordPress core, plugin, and theme files are up-to-date. However, it seems that the issue is specific to the custom pdb-tabs template or the Participants Database plugin itself.

    I would greatly appreciate any guidance or assistance you can provide in resolving this problem. Thank you for your attention to this matter.

    Best regards,
    Elvis

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

    (@xnau)

    Best way to approach this is to start with the built in template unaltered. If that is working than you know that any changes you introduce to the template are causing a problem. Make incremental changes to the template and test each time so that you know what is tripping things up.

    If the built in template is not working, firgure that out first.

    Thread Starter eljailer

    (@eljailer)

    Thank you for your response. I followed your instructions and started with the built-in template without any alterations. The unaltered template is not causing issues.

    Upon further investigation, it appears that the following code snippet is causing the problem:

    <?php
    // Create a template object so we can get the edit link URL
    $record = new PDb_Template($this);
    // Now output the link using the get_edit_link method
    ?>
    <button class="btn btn-default uredi">
      <a id="uredi" href="<?php echo $record->get_edit_link() ?>">Edit record</a>
    </button>

    When this snippet is present in the template, I encounter the error mentioned in my previous post. However, if I remove this snippet, the template works fine without any errors.

    I would appreciate any guidance or insights on how to resolve this issue and successfully integrate the edit link functionality into the custom pdb-tabs template.

    This code worked perfectly fine in the previous version of WordPress and the previous version of the Participants Database plugin. However, it seems to be causing issues in the latest versions.

    Thank you for your attention to this matter.

    Plugin Author xnau webdesign

    (@xnau)

    Thanks. I am not seeing any problems with this code in my tests, but I’m not able to test the specific conditions you have there, so I can’t say what the problem is.

    My guess is that the PDb_Template class is attempting to instantiate on a record that doesn’t exist, or there is something about the configuration that is preventing the class from instantiating correctly…an empty group perhaps.

    If your custom template is based on one of the gists I posted, try testing using that template unaltered.

    Thread Starter eljailer

    (@eljailer)

    OK, thank you for your response.

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

The topic ‘Custom pdb-single template – edit link’ is closed to new replies.