WordPress.org

Ready to get started?Download WordPress

Forums

Connections Business Directory
Error messages with some shortcodes (10 posts)

  1. keress
    Member
    Posted 3 years ago #

    We're trying to get the [connections list_type='family'] shortcode to work but it keeps throwing up these errors:

    Warning: Invalid argument supplied for foreach() in /home/pmhoa/public_html/wp-content/plugins/connections/templates/members/template.php on line 97

    Warning: Invalid argument supplied for foreach() in /home/pmhoa/public_html/wp-content/plugins/connections/templates/members/template.php on line 139

    I've tried uninstalling, deleting all connections database tables and reinstalling. I tried deactivating all plugins.

    I tried uncommenting line 51

    //$member_popup_info = '<div id="popup-group-name"><span>' . $entry->getFamilyName() . '</span></div>';

    but then it kicked up some new error messages:

    Warning: Invalid argument supplied for foreach() in /home/pmhoa/public_html/wp-content/plugins/connections/templates/members/template.php on line 97

    Warning: Invalid argument supplied for foreach() in /home/pmhoa/public_html/wp-content/plugins/connections/templates/members/template.php on line 139

    This is odd since I tested it on another of my sites with the same host and it worked (except the family line had no link to a pop-up).

    Thanks for any help! We hope we can get this working since it seems the best out there and just what we need.

  2. keress
    Member
    Posted 3 years ago #

    I got it to work by commenting out of wp-content/plugins/connections/templates/members/template.php the following lines

    line 51

    // $member_popup_info = '<div id="popup-group-name"><span>' . $entry->getFamilyName() . '</span></div>';

    line 97

    // foreach ($entry->getPhoneNumbers() as $key_homephone=>$value_homephone) {

    line 409

    //}

    line 103

    // foreach ($value_homephone as $key_homenumber=>$value_homenumber) {

    line 133
    // }

    Thanks!

  3. keress
    Member
    Posted 3 years ago #

    Spoke too soon. It appears to work, but it's not displaying addresses, and will only display cell phone #'s, not home phones. I guess that's not surprising considering what I commented out.

  4. shazahm1
    Member
    Plugin Author

    Posted 3 years ago #

    Which version of Connections are you using, that is an error that was resolved in the latest release.

  5. keress
    Member
    Posted 3 years ago #

    I did a search through the code and found 0.7.1.5. Does that sound right? I got the plugin by doing the "Search for New Code" in the Plugins section, and bringing it straight into WordPress, so I assume it's the download that's currently on WordPress.

  6. shazahm1
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, that is the current version, the problem is that none of the line numbers align with the current code.

  7. keress
    Member
    Posted 3 years ago #

    The lines I commented out were as above, except for the first, which was a few lines away, if memory serves. What can I do to help get this figured out?

    Which of the templates should I be using? I've tried both the default and Single Entry for all.

    Could this be host-related? As I said, I've tried it on another of my sites, same host, different server, and I don't get any error messages, but the first display of the family name has no link to the pop up.

  8. keress
    Member
    Posted 3 years ago #

    I've stumbled onto something with this, though I don't know what to make of it. I checked on my "settings" and found that I had one of the shortcode attributes overrides allowed (not sure which now). When I unchecked that, the error messages went away, but so did the pop-up. Re-selecting either does not bring back the errors, or the pop ups. Here's what I'm getting:

    http://lkctest2.info/members-only-section/directory/

    BTW A suggestion. It would be useful to add a relation of "self' -- for people who live alone.

  9. keress
    Member
    Posted 3 years ago #

    I set up a new wordpress installation, on an entirely different host, (using cpanel) which has Connections as the only plugin installed. I've figured out that the pop up which lists the individual family members and their emails will show only when using the "members" template set for "family". That kicks up the sort of error messages I reported in my first post in this thread. BUT, I got rid of them by adding an address and phone number in the "Family" entry. Apparently, we can work around this by making sure those two fields are filled in for each family.

    I'm going to see if I can figure out how to add the family member's individual phone numbers as well as emails, and also get the address to display under the family heading in the pop-up. With that, we should be good to go.

    Thanks!

  10. keress
    Member
    Posted 3 years ago #

    Okay, I figured out the reason why the pop-up was not displaying the cell phone #'s was because I had not set them as cell-phone numbers. They were all defaulted to home phone, which I guess will only display for the family listing.

    And the address wasn't displaying because I needed to fill in all the fields for address, including latitude and longitude. A bit more than we expected, but a very cool thing to be displaying.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic