Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • I found the cause of this issue. Video-js.php is using the mce_buttons filter to write some options to each page. ACF is also using that filter but is pulling in the echoed code in that filter to it’s javascript. (see https://cl.ly/image/28390z313i2o)

    To avoid this error I simply move the line that is retrieving and echoing the options (line 287 and 288 in video-js.php) to live within the mce_external_plugins filter 6 lines below that. The options still get echoed to the DOM and ACF doesn’t rewrite it into it’s JS. Seems that all parties are happy.

    So for an example…. this code at the bottom of video-js.php:

    function register_video_js_button($buttons) {
    	array_push($buttons, "|", "videojs");
    	$options = get_option('videojs_options');
    	echo('<div style="display:none"><input type="hidden" id="videojs-autoplay-default" value="' . $options['videojs_autoplay'] . '"><input type="hidden" id="videojs-preload-default" value="' . $options['videojs_preload'] . '"></div>'); //the default values from the admin screen, to be used by our javascript
    	return $buttons;
    }
    
    function video_js_mce_plugin($plugin_array) {
    	$plugin_array['videojs'] = plugins_url( 'mce-button.js' , __FILE__ );
    	return $plugin_array;
    }

    Becomes this:

    function register_video_js_button($buttons) {
    	array_push($buttons, "|", "videojs");
    	return $buttons;
    }
    
    function video_js_mce_plugin($plugin_array) {
    	$options = get_option('videojs_options');
    	echo('<div style="display:none"><input type="hidden" id="videojs-autoplay-default" value="' . $options['videojs_autoplay'] . '"><input type="hidden" id="videojs-preload-default" value="' . $options['videojs_preload'] . '"></div>'); //the default values from the admin screen, to be used by our javascript
    	$plugin_array['videojs'] = plugins_url( 'mce-button.js' , __FILE__ );
    	return $plugin_array;
    }

    I’m sure there is a better way to do this, but this seems to at least do the trick for now.

    I saw the same issue. Also when I go to the media page in admin I get this where the file size should be:
    Warning: filesize(): stat failed for /path/to/image.jpg in /path/to/site/wp-content/plugins/media-file-sizes/media_file_sizes.php on line 141

    This is only with debug = true.

    I found that this happens only with images that do not exist and/or are missing (imported database without downloading uploads directory).

    This fixed it. Added the following to line 141 before the filesize() call:
    if ( ! file_exists( $orig_full_path ) ) return;

    Thread Starter akv2

    (@akv2)

    Yes, clicking “reset sorting” fixes the issue and brings the pagination back. But as soon as I navigate with the paging, or reload the page pagination is gone again.

    I hope this helps.

    Here was the fix for us. We changed our permissions on the ‘uploads’ directory to 755 recursively (-R). We also realized that our apache user was different than our server admin user (and different than root) [Note: run ‘top’ in the command line to see what user is running apache]. That means that when we changed our permissions we were not doing it for the user that was pulling the error. We had to add our apache user to our server admin group so they would receive the permission changes.

    * Do some research on this command before using *
    usermod -a -G {group_name} {username}

    I’m not saying that this is the fix for everyone, as everyone’s server configurations are different… but I did want to share what was the fix for us.

Viewing 4 replies - 1 through 4 (of 4 total)