• Resolved niznet

    (@niznet)


    When we install the plugin for the first time, it triggers an Undefined array key "profit_share" warning on the user settings page.

    /web/app/plugins/mycred/addons/sell-content/myCRED-addon-sell-content.php:583
    
    $setup['excluded'] = false;
    
    $settings = mycred_get_option( 'mycred_sell_this_' . $point_type_key );
    
    $setup['default'] = $settings['profit_share'];
    
    $users_share = mycred_get_user_meta( $user->ID, 'mycred_sell_content_share_' . $point_type_key, '', true );
    
    if ( strlen( $users_share ) > 0 ) {
    
    	$setup['override'] = true;
    • This topic was modified 2 years, 8 months ago by niznet.
    • This topic was modified 2 years, 8 months ago by niznet.
Viewing 3 replies - 1 through 3 (of 3 total)
  • A.Tariq

    (@arsalantariq)

    @niznet,

    Thank you for contacting us, Can you make a short video of the issue. It will help us in identifying why this issue is occurring on your website. We have tested it in our environment. We are not receiving any such error.

    Thread Starter niznet

    (@niznet)

    It’s only happening when we enable the debug mode and currently we trying to integrate mycred with the sage theme that in development mode will make a full stop with exception when there’s any undefined array/object key.

    Another same issue example with screenshot, in this case, is when calling the mycred_get_content_price() function when we do not set MYCRED_DEFAULT_TYPE_KEY as the second argument which $setup inside the code leads to null and triggers the warning,

    Undefined array key issues in mycred

    • This reply was modified 2 years, 8 months ago by niznet.
    A.Tariq

    (@arsalantariq)

    @niznet,

    In calling the mycred_get_content_price() function, the second argument is required argument. If you will leave the second argument empty it will trigger a warning/error.

    For your second issue, we will try to replicate your scenario in our environment and let you know about it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Undefined array key “profit_share”’ is closed to new replies.