WordPress.org

Forums

Participants Database
image-upload link issue (10 posts)

  1. birkoff1
    Member
    Posted 3 years ago #

    Roland -

    I finished configuring my pdb_single template and am having an issue with the image upload. Using the default field, the images are uploading fine, but for some records the image field value is the file name, and others it's the entire file url (not even relative, full http:// to .jpg).

    I've tried deleting and re-uploading, changing the receiving directory, uploading through backend form vs. admin form; and no matter what I try some end up one way and others end up the other way. The custom function I posted previously uses the same mySQL function as the original to populate the variable, and was added to a virgin backup of participants-database.php, so I'm fairly sure the problem precedes the calling of the data itself.

    Any thoughts?

    http://wordpress.org/extend/plugins/participants-database/

  2. xnau
    Member
    Plugin Author

    Posted 3 years ago #

    birkoff1,

    The filename is handed off to PHP by the browser, I don't do anything to it, so if the browser is giving a absolute path to the file, that's what gets saved...but the plugin should be able to display it properly if the image file is in the file uploads directory.

    Do you know under what circumstances you get the absolute address for the image file?

  3. birkoff1
    Member
    Posted 3 years ago #

    I can't...at different times it was happening to different members, but it might be that browser caching before I re-uploaded the faulty images made it look worse than it was.

    I adapted by adding an if-else statement in my template that mirrored the value to a new variable and concatenated the relative filepath where strlen()<40, so it's displaying fine. I just know that without the custom template and plugin mods, those values would process through Participants_Db::prep_field_for_display, and that might have made it so the issue wasn't noticed, so I thought I'd mention it. I could swear I'd read something about this in your support forum, but I couldn't find it in a few passes.

    A different problem that is still a problem is that saving the backend form erases all the fields in my Member tab, which are not set to display in either one. I was able to work-around by having it display on the backend and manually hiding the edit boxes in css, but I'd still prefer not to display the category at all. Any ideas for that?

  4. xnau
    Member
    Plugin Author

    Posted 3 years ago #

    This last issue, I have to admit I don't understand what you're trying to accomplish. By "category" do you mean the field group? And you want this field group to not be seen in the admin? Perhaps you could explain what it is you're trying to do.

  5. birkoff1
    Member
    Posted 3 years ago #

    Yes, field groups.

    To streamline a bit, let's say I have four field groups: Visitors, Info, Admin, and Profile:
    Visitors - fields about if you want to visit/join the mailing list/be contacted by a host.
    Info - a modified version of your "Main" - just contact info.
    Admin - Member = yes/no/former, leadership title, group assignments. Nobody should be touching this except admins.
    Profile - photo, blurb, personal website link that can display in your pdb_single profile.

    The frontend form (linked) shows all Visitors fields and most Info fields.

    If a person becomes a member, I assign them member=Yes and assign them a business category and team. They get the link to the backend form, which displays the Info and Profile field groups.

    My pdb_list displays a group roster with some fields from Info and the business category I assigned in admin where member=yes.

    With this setup, if I use the backend form to submit update information, they disappear from the roster (member='') and the team and business category assignments also erase.

  6. xnau
    Member
    Plugin Author

    Posted 2 years ago #

    birkoff1,

    Sorry, it's been a few days...

    So, by what process do you assign the membership and business category? And what kinds of fields are you using for your membership flag and the business category?

  7. birkoff1
    Member
    Posted 2 years ago #

    membership has check boxes for yes,no,rejected,former. biz_category is a text field. team is a drop-down.

    Once a person's in the system, I populate those fields from the admin side, clicking "Edit" on their record in the "List Participants" dashboard view.

    When the displayed categories are edited from the backend form, all of those values (when the category is not displayed) are vacated. They don't default back to anything, they're just null.

  8. xnau
    Member
    Plugin Author

    Posted 2 years ago #

    OK, all this stuff should work, no problem. So, let me get this straight: when a record comes in, you go into the admin and set the membership, category and team fields. But, when you try to save then, they come back blank. Right? So you can't successfully save those fields?

    You mention defaults...are you setting default values for those fields?

    The only thing I'm thinking might cause this would be the names of the fields, there are a few cases where there are name conflicts that can cause problems with saving fields.

  9. birkoff1
    Member
    Posted 2 years ago #

    You're misreading my problem.

    When I fill out the membership, category, and team fields, they save just fine. Whether the record was created by myself or using the frontend form to begin with, I have no problem saving the data I enter.

    However, if a user uses their private link to update data through the backend form, and the backend form is set to not display the admin field category, the fields in that category are all nulled out when the user saves changes. So I give them their private link, and they add a photo and bio blurb, for example, and save, all of those admin fields are then erased.

    If I elect to display the Admin field group on the backend form (which for obvious reasons I don't want) the data isn't erased.

  10. xnau
    Member
    Plugin Author

    Posted 2 years ago #

    OK...now I understand and I see I need to tighten up my code a bit...

    And here's the fix:

    In participants-database.php on line 1085 you'll find:

    $new_value = NULL;

    Change this to:

    $new_value = false;

    This will cause those fields that are not included in the form (as in on the frontend record edit) to be skipped, and their current value left alone.

    Sorry it took me so long to get to this, but you've helped me find a bug...thanks and let me know if this doesn't fix your problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Participants Database
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.