WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] BUG REPORT: Fatal error: Cannot redeclare this_to_int() (5 posts)

  1. Darren Ethier (nerrad)
    Member
    Posted 3 years ago #

    This report is brought from the thread over here -> http://wordpress.org/support/topic/organize-series-23-upgrade-messes-things-up?replies=17 (to avoid doing two issues in one thread).

  2. Darren Ethier (nerrad)
    Member
    Posted 3 years ago #

    @Tuscanytrace,

    I'm unable to reproduce your error so I suspect there is a function collision with another plugin installed. Try out the following (if it works for you I will include in an update).

    In the file orgSeries-utility.php go to line 196 where it has this:

    function os_strarr_to_intarr($array) {
    	if ( empty($array) ) return;
    	function this_to_int(&$val, $key) {
    		$val = (int) $val;
    	}
    
    	array_walk($array, 'this_to_int');
    
    	return $array;
    }

    Replace all of the above with this:

    function os_strarr_to_intarr($array) {
    	if ( empty($array) ) return;
    	array_walk($array, 'os_this_to_int');
    	return $array;
    }
    
    function os_this_to_int(&$val, $key) {
    		$val = (int) $val;
    }
  3. Tuscanytrace
    Member
    Posted 3 years ago #

    thanks! That appears to have fixed it! I don't know yet if the fix broke anything else. Where would logical areas to break be? Photo uploading? I don't have anything other than the native WP photoediting abilities installed.

    Thanks!

  4. Darren Ethier (nerrad)
    Member
    Posted 3 years ago #

    It shouldn't break anything else. All I did was give the function a more unique name (and a bit better structure) so it wouldn't collide with any other plugins that might have a function with the same name.

    Thanks for reporting back :)

  5. Tuscanytrace
    Member
    Posted 3 years ago #

    Great, and thanks again! I'd already thought this plugin is on the must-have list for multi-author sites just from what it does. Now I think so from what *you* do.

Topic Closed

This topic has been closed to new replies.

About this Topic