Change WordPress user roles and capabilities Forums Bug Reports WP File Download + URE Pro – Meta Boxes – logic and pop broken?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5071
    [email protected]
    Participant

    Hello,

    I’m testing the new version of a plugin WP File Download (JoomUnited) and this line in their code is causing an error. Tracing it, looks like URE Pro is breaking when computing metaboxes rules?

     //force the WPFD menu box alway show on screen
        $hidden_nav_boxes = (array)get_user_option('metaboxhidden_nav-menus');

    Looking at logs:
    Got error ‘PHP message: PHP Warning: A non-numeric value encountered in /htdocs/wp-content/plugins/user-role-editor-pro/pro/includes/classes/meta-boxes.php on line 434\nPHP message: PHP Warning: A non-numeric value encountered in /htdocs/wp-content/plugins/user-role-editor-pro/pro/includes/classes/meta-boxes.php on line 434\n’, referer: <site>/wp-admin/network/users.php?page=users-user-role-editor-pro.php

    When I try to look at the Meta Boxes settings in Network Admin, I get a JS error:
    Uncaught SyntaxError: Unexpected token W in JSON at position 1
    at JSON.parse (<anonymous>)
    at Function.n.parseJSON (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,moxiejs,plupload&ver=4.9.8:4)
    at Function.a.parseJSON (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,moxiejs,plupload&ver=4.9.8:9)
    at Object.success (meta-boxes-access.js?ver=4.9.8:26)
    at i (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,moxiejs,plupload&ver=4.9.8:2)
    at Object.fireWith [as resolveWith] (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,moxiejs,plupload&ver=4.9.8:2)
    at y (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,moxiejs,plupload&ver=4.9.8:4)
    at XMLHttpRequest.c (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,moxiejs,plupload&ver=4.9.8:4)

    
    Warning: A non-numeric value encountered in /misc/osdatadev/dev/devmyapps.northcarolina.edu/htdocs/wp-content/plugins/user-role-editor-pro/pro/includes/classes/meta-boxes.php on line 434
    
    Warning: A non-numeric value encountered in /misc/osdatadev/dev/devmyapps.northcarolina.edu/htdocs/wp-content/plugins/user-role-editor-pro/pro/includes/classes/meta-boxes.php on line 434
    "{\"result\":\"success\",\"message\":0,\"html\":\"<form name=\\\"ure_meta_boxes_access_form\\\" id=\\\"ure_meta_boxes_access_form\\\" method=\\\"POST\\\"\\n      action=\\\"https:\\\/\\\/devmyapps.northcarolina.edu\\\/wp-admin\\\/network\\\/users.php?page=users-user-role-editor-pro.php\\\" >\\n<table id=\\\"ure_meta_boxes_access_table\\\">\\n    <th style=\\\"color:red;\\\">Block<\\\/th>\\n    <th class=\\\"ure-cell\\\">Title<\\\/th>        \\n    <th cla........ value=\"\/wp-admin\/admin-ajax.php\" \/><\/form>    \n"} 
    

    I check the pro/classes/meta-boxes.php line 434 the code is this:

            return array('result'=>'success', 'message'=>'Widgets permissions for '+ $ure_object_name, 'html'=>$html);        
    

    Not sure what is broken here – we need to move to PHP7 soonf or our prod site. This is in dev and breaking.
    PHP 7.1.8
    WP 4.9.8
    URE PRO 4.42.b1
    WP File Download 4.3.23

    #5072
    [email protected]
    Participant

    It seems like the Javascript error in User Role Editor Settings on a subsite if for
    Meta boxes,
    Posts Edit,
    Posts View
    Widgets
    Admin Menu

    #5087
    Vladimir
    Keymaster

    Thanks for finding this. Line 434 at meta-boxes.php has a syntax error. It should use ‘.’ operator for strings concatenation instead of ‘+’. So valid code will be:

    
    return array('result'=>'success', 'message'=>'Widgets permissions for '. $ure_object_name, 'html'=>$html);
    

    I will include this fix into the next version 4.47.3. Let me know the result of your testing with updated version of this file.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.