gig4bite
Forum Replies Created
-
Looks like another way to get response for posts page to load (without removing the above mentioned lines of code and without disabling the entire plugin) is explicitly declaring $sharing_meta as array.
Line 205 /wp-content/plugins/sassy-social-share/admin/class-sassy-social-share-admin.php
The following original code loads blank post page:
$sharing_meta = get_post_meta( $post->ID, ‘_heateor_sss_meta’, true );Declaring $sharing_meta as array loads post page:
$sharing_meta = array(get_post_meta( $post->ID, ‘_heateor_sss_meta’, true ));Is the “checked()” to grab the post meta to check if one of these checkboxes had already been selected when editing an existing post?
This is on php8 with php-fpm. So not sure if this is something that is causing specific errors for php8 and/or php-fpm or if just an issue specific to certain setup environments.
Looks like the issue is stemming from these 2 lines of code for the checkbox fields loading at the bottom of the new and edit posts page for admin.
Particularly the two snippets:
<?php checked( ‘1’, @$sharing_meta[‘sharing’] ); ?>
<?php checked( ‘1’, @$sharing_meta[‘vertical_sharing’] ); ?>If these are removed, then the “new” and “edit” posts page appear to fully load for editing and posting. But not if either or both are left intact. When clicking edit post or new post, then only a blank page will load with no ability to post. Can also regain access to posting by disabling the entire plugin in order to get the “new post” or “edit post” link to load.
These are located on line 209 of the file /wp-content/plugins/sassy-social-share/admin/class-sassy-social-share-admin.php
<label for=”heateor_sss_sharing”>
<input type=”checkbox” name=”_heateor_sss_meta[sharing]” id=”heateor_sss_sharing” value=”1″ <?php checked( ‘1’, @$sharing_meta[‘sharing’] ); ?> />
<?php _e( ‘Disable Standard Sharing interface on this ‘ . $postType, ‘sassy-social-share’ ) ?>
</label>
<br/>
<label for=”heateor_sss_vertical_sharing”>
<input type=”checkbox” name=”_heateor_sss_meta[vertical_sharing]” id=”heateor_sss_vertical_sharing” value=”1″ <?php checked( ‘1’, @$sharing_meta[‘vertical_sharing’] ); ?> />
<?php _e( ‘Disable Floating Sharing interface on this ‘ . $postType, ‘sassy-social-share’ ) ?>
</label>Wordpress Error message:
An error of type E_ERROR was caused in line 209 of the file /wp-content/plugins/sassy-social-share/admin/class-sassy-social-share-admin.php. Error message: Uncaught TypeError: Cannot access offset of type string on string in /wp-content/plugins/sassy-social-share/admin/class-sassy-social-share-admin.php:209
Stack trace:
#0 /wp-admin/includes/template.php(1389): Sassy_Social_Share_Admin->sharing_meta_setup(Object(WP_Post), Array)
#1 /wp-admin/includes/post.php(2315): do_meta_boxes(Object(WP_Screen), ‘advanced’, Object(WP_Post))
#2 /wp-admin/edit-form-blocks.php(443): the_block_editor_meta_boxes()
#3 /wp-admin/post.php(187): require(‘…’)
#4 {main}
thrown