Support

Account

Forum Replies Created

  • Thanak you, John, for your advice!

    I think I will give the repeater field a try with the language being a dropdown selection of the language taxonomy terms. My only conern here is that the user can create duplicates of the same language, so maybe I need to find a JS-based solution to suppress this.

    The hierarchical post type sounds interesting as well, I’ve never used this so far. But that would mean that you’d have to edit every language version separately, right? This could maybe get too time-consuming compared to having all the stuff in one place.

    Thanks again,
    Michael

  • @hube2, thanks for your quick reply, I now see what’s going on. Two things:

    Firstly, the issue has obviously always been there, but only PHP 7.4 shows a notice.

    Secondly, maybe to help others:

    I have set up a field as yes/no toggle with ‘no’ as default value. Now when I create a new post and ‘no’ is already the right value for this field, then it won’t be created in the database on saving the post—as long as you don’t set it to ‘yes’, update the post, and set it back to ‘no’ again.

    So my solution here is to check if the field exists at all, and if not, assume it is ‘no’:

    
    $field_object = get_field_object( 'p_props_' . $grp . '_' . $v );
    
    if ( !$field_object ) :
      // Field doesn’t exist --> false
      // ...
    
    else :
      if ( $field_object['type'] == 'true_false' ) :
    

    Again, thank you very much!

  • Hi there!

    Any news on this? Since running on PHP 7.4, I also encounter this error:

    Notice: Trying to access array offset on value of type bool in […]/products.php on line 169

    The code itself is quite simple:

    
    167|  $field_object = get_field_object( 'p_props_' . $grp . '_' . $v );
    168|
    169|  if ( $field_object['type'] == 'true_false' ) :
    

    And what does this error actually mean? I can’t see any issue on the page besides the debug error message.

    Thanks for any help!

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