Home Forums Plugin Support WP User Frontend Pro Illegal offset type error on checkboxes

This topic is: not resolved

This topic contains 4 replies, has 3 voices, and was last updated by  Nayem 3 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #55090

    Véber
    Member
    Post count: 4

    Hi,
    I try to show some child categories as checkboxes. I have the parent with ID 25.

    So I select the post field: “Category”

    In the box I set:
    type: checkbox
    order by: name
    order: asc
    child of: 25

    and on the frontende i get the following message: Warning: Illegal offset type in isset or empty in C:\wamp\www\travelblog03\wp-includes\taxonomy.php on line 1701

    Call Stack
    # Time Memory Function Location
    1 0.0006 251928 {main}( ) ..\index.php:0
    2 0.0009 255464 require( ‘C:\wamp\www\travelblog03\wp-blog-header.php' ) ..\index.php:17
    3 0.8013 59151088 require_once( ‘C:\wamp\www\travelblog03\wp-includes\template-loader.php' ) ..\wp-blog-header.php:16
    4 0.8241 59886616 include( ‘C:\wamp\www\travelblog03\wp-content\themes\Newspaper\page.php' ) ..\template-loader.php:74
    5 1.1378 61991752 the_content( ) ..\page.php:161
    6 1.1379 61992464 apply_filters( ) ..\post-template.php:230
    7 1.1388 61995936 call_user_func_array ( ) ..\plugin.php:213
    8 1.1388 61995968 do_shortcode( ) ..\plugin.php:213
    9 1.1390 62000416 preg_replace_callback ( ) ..\shortcodes.php:200
    10 1.1390 62002080 do_shortcode_tag( ) ..\shortcodes.php:200
    11 1.1390 62002664 call_user_func ( ) ..\shortcodes.php:286
    12 1.1390 62002704 WPUF_Frontend_Form_Post->add_post_shortcode( ) ..\shortcodes.php:286
    13 1.1399 62035624 WPUF_Render_Form->render_form( ) ..\frontend-form-post.php:51
    14 1.1574 62608856 WPUF_Render_Form->render_items( ) ..\render-form.php:299
    15 1.1574 62615120 WPUF_Render_Form->taxonomy( ) ..\render-form.php:482
    16 1.1574 62615712 wpuf_category_checklist( ) ..\render-form.php:1312
    17 1.1609 63059040 get_terms( ) ..\wpuf-functions.php:364

    with multiselect, ajax or dropdown it works, bur the checkbox makes this error.

    What can be the problem?

    Thanks

    #55167

    towhid
    Participant
    Post count: 4505

    Hello Véber,

    I have tried to reproduce this issue but failed. It could be a has a chance of theme or plugin conflicts. You can disable all your plugins except User Frontend and switch to a default theme of WordPress like- Twenty Twelve, Twenty Thirteen, Twenty Fourteen and let me know the results.

    Thanks

    #56507

    Véber
    Member
    Post count: 4

    Hm, very strange. I installed a clean wordpress 4.2.2 (twentyfifteeen). Database: utf8-general-ci. The only plugin: wp user frontend pro. I made a simple category tree: cat-main / cat-child1, cat-child2, cat-child3 and I got the same error.

    With dropdown, multiselect . . . everything is perfect.
    With child of + checkbox I get an error.

    #56510

    Véber
    Member
    Post count: 4

    ok, so I found the problem:

    wpuf-functions.php

    330. * Displays checklist of a taxonomy *
    function wpuf_category_checklist

    361.

    $categories = (array) get_terms( $tax, array(
            'hide_empty'  => false,
            $exclude_type => (array) $exclude,
            'orderby'     => isset( $attr['orderby'] ) ? $attr['orderby'] : 'name',
            'order'       => isset( $attr['order'] ) ? $attr['order'] : 'ASC',
        ) );

    here is the $exclude_type => (array) $exclude row

    I dont know why, but this coding generates the error on my enviroment.

    So I changed the $exclude_type => (array) $exclude to $string = implode(',', $exclude); and $exclude_type => $string

    Seems it works, but I fear, that this can cause some problem in the future?

    Thanks

    #56553

    Nayem
    Moderator
    Post count: 6480

    Hello,

    I am very glad to know that you have found the solution. I think it will not cause any problem in near future.

    Thanks.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Illegal offset type error on checkboxes’ is closed to new replies.