Warning: Invalid argument supplied for foreach() in /wp-content/plugins/directory/ui-front/general/d

I installed the Directory plugin.

I created a few categories.

I added a listing.

I went to view the listing.

Under the list the following message appears:

Warning: Invalid argument supplied for foreach() in /wp-content/plugins/directory/ui-front/general/display-custom-fields-values.php on line 45

I have removed my hosting info from the error message.

I have now deactivated the plugin after deactivating and reactivating the plugin.

  • Kimberly
    • Champion of Loops

    LookSee China Canada,

    Hello and thanks for using WPMU forums!
    I'm going to flag a developer to come and have a looksee.

    Did you get this error at any other time? Were you able to view the front page of the directory?

    Did you have any custom fields in the listing?

    Best,

    Kimberly

  • Tydbytes
    • Flash Drive

    I have never encountered this error before.

    If by view front page you mean the page that says 'Listings' then yes.

    When you select 'Read More' you are then taken to a page that lists the entry and the error message appears below this.

    This whole thing doesn't look like what I was anticipating with a list of categories yahoo directory style but who knows maybe it will end up looking like that. Otherwise I'll use a php directory script. This is already taking more time than planned. But what else is new when dealing with WP. hahaha

  • Kimberly
    • Champion of Loops

    Yeah this is a new one for me too :slight_smile:

    Do you have any custom fields in your listing? If so perhaps there is an issue with the embed code placement?

    or perhaps it's a theme conflict? maybe try reverting to a default to see if it goes away.

    I'd ask you to reinstall it just to make sure everything came in ok if you don't have any custom fields inserted :slight_smile:

  • Tydbytes
    • Flash Drive

    No custom fields.

    Tried a re-install and still the same problem.

    As for looking for conflicts with this and that I have no time to play around with that. For me it is simple. It doesn't work.

    I need to add some functionality to my website and hoped this plugin could do it but it has a bug or bugs. So I will find another solution that simply works.

    In the past I have used LinkUp Gold from phpwebscripts to create yahoo like directories so I will just do that again. It is not a WP solution but I know it works.

    Thanks for your help.

  • Kimberly
    • Champion of Loops

    LookSee China Canada,

    Admittedly this plugin falls short in many respects.

    It does not meet the standards of WPMU plugins and we are working to get it vetted as soon as possible.

    I understand you need to move on with another solution and my apologies for frustration.

    I will mark as resolved, just for housekeeping, since it seems there is nothing else we can do for you if you have decided to move on to another plugin.

  • Arnold
    • El Macho WP

    @hannapanna

    Install a copy of CustomPress plugin and create a custom field for directory_listing post type. It's complaining about an empty list of custom fields.

    Directory has a lot of problems currently and one of them is that the custom fileds, Taxonomy editor got left out. CustomPress supplies that and much more. I just inherited this plugin and it's goping to take a while to work through everything.

  • coloradomoms
    • New Recruit

    I had the same issue. I simply opened the file - /public_html/wp-content/plugins/directory/ui-front/general/display-custom-fields-values.php

    and deleted all of the below code until a fix is released. Seems to be a temp fix. :wink: Hope this helps!

    - `<?php echo $field_template[$val]['open']; ?>

    <?php foreach ( $custom_fields as $custom_field ): ?>
    <?php foreach ( $custom_field['object_type'] as $custom_field_object_type ): ?>
    <?php if ( $custom_field_object_type == $post->post_type ): ?>
    <?php $output = true; break; ?>
    <?php endif; ?>
    <?php endforeach; ?>

    <?php
    if ( isset( $custom_field['field_wp_allow'] ) && 1 == $custom_field['field_wp_allow'] )
    $prefix = 'ct_';
    else
    $prefix = '_ct_';
    ?>

    <?php if ( $output ): ?>

    <?php echo $field_template[$val]['open_line']; ?>
    <?php echo $field_template[$val]['open_title']; ?>
    <?php echo ( $custom_field['field_title'] ); ?>:
    <?php echo $field_template[$val]['close_title']; ?>
    <?php echo $field_template[$val]['open_value']; ?>
    <?php echo ( get_post_meta( $post->ID, $prefix . $custom_field['field_id'], true )); ?>
    <?php echo $field_template[$val]['close_value']; ?>
    <?php echo $field_template[$val]['close_line']; ?>

    <?php endif; $output = false; ?>
    <?php endforeach; ?>

    <?php echo $field_template[$val]['close']; ?>`

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.