Welcome, Guest
Username: Password: Remember me

TOPIC: Post Lockout Notification & eBook Conflict

Post Lockout Notification & eBook Conflict 4 years 4 months ago #4229

The default locked notification ("Another user is editing this post , take over editing?") notice is overridden by eBook usage embedding options.

The issue is in the way WP_Query loop is used to display that eBook promo on post edit page ("Ebook Store - Click on Ebook to embed it") and it resets global post object. The message and allowed user to take over post editing is replaced with a button that only take the user to the eBooks main page.
We fixed this manually / temporarily with some code which prevents from this directly in the plugin code.
Obviously we don't have a pull request opportunity but I would recommend we add same or similar checks to prevent this for future updates in:
~/wp-content/plugins/ebook-store/functions.php
 function ebook_wp_embed_ebook() {
line 2247 +        global $post;
linr 2248 +        $backup_post = $post;

 	wp_enqueue_script( 'ebook_store_settings', plugins_url( '/js/ebook_store_settings.js' , __FILE__ ), array(), '1.0.0', true );
 	?>
 	<div class="ebook_store_embed_all_items" style=" display:inline-block; clear:both; max-height:200px; overflow-x:auto; width:100%;">

&&
 	?>
 	</div>
 	<?php
Line 2292 +        wp_reset_postdata();
Line 2293 +        $post = $backup_post;

 }
The administrator has disabled public write access.
Time to create page: 0.221 seconds