• Resolved whatspauldoing

    (@whatspauldoing)


    Good Afternoon,

    I’ve come up against 2 ghost posts at the end of each of my reorder lists, I see someone else had this issue and I’ve tried to reset the order but they’re still there.

    Do you have any other ideas of how to get rid of them?

    Cheers,

    Paul

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter whatspauldoing

    (@whatspauldoing)

    I think i’ve found the problem and I’ve implemented a check on my version of the plug-in as a workaround but you might want to do something better.

    In the function:

    	 function updateSortableList(response){
    		 $sortable.sortable('destroy');
    		 $sortable.html('');
    		 for (var idx in response.data) {
                          var $html = $('<div data-id="'+response.data[idx].id+'" class="sortable-items"></div>');
    		      $html.append($('<img src="'+response.data[idx].img+'" />'));
    	              $html.append($(
    				    '<span class="title">').append($('<a href="'+response.data[idx].link+'">'+response.data[idx].title+'</a>')));
    		      $sortable.append($html);
    		 }
    		 sortableItems();
    	 }

    At the end of the loop it’s adding 2 items:
    adler32
    crc32

    which are showing as valid sortable items.

    Given that we’re only looking for post ID’s I’ve added an old school integer check and ignore anything that isn’t.

    	 function updateSortableList(response){
    		 $sortable.sortable('destroy');
    		 $sortable.html('');
    		 for (var idx in response.data) {
                 if(idx * 1 == idx) {
    			     var $html = $('<div data-id="'+response.data[idx].id+'" class="sortable-items"></div>');
    			     $html.append($('<img src="'+response.data[idx].img+'" />'));
    			     $html.append($(
    				    '<span class="title">').append($('<a href="'+response.data[idx].link+'">'+response.data[idx].title+'</a>')));
    			     $sortable.append($html);
                 }
    		 }
    		 sortableItems();
    	 }

    This looks to be working for me now when I’m viewing the whole list and dragging and dropping.

    If you know what’s causing those 2 extra ID’s it would be great to know how to get rid of them.

    Thanks for all your hard work.

    Paul

    Plugin Author Aurovrata Venet

    (@aurovrata)

    ’ve come up against 2 ghost posts

    this can happen if the order data wasn’t set up properly, and should go away if you rest your order (see the screenshot #3). Did you try that?

    Thread Starter whatspauldoing

    (@whatspauldoing)

    I did but they still remained.

    Would they be extra records in the database? I had a search though but I couldn’t find anything matching crc32 or adler32 in postmeta.

    Cheers,

    Paul

    Plugin Author Aurovrata Venet

    (@aurovrata)

    Would they be extra records in the database?

    odd indeed. Are you using WooCommerce?

    I had a search though but I couldn’t find anything matching crc32 or adler32 in postmeta.

    no, the plugin does not create any post, only post ranks in meta fields.

    Are you sure you do not have posts with such titles? Possibly some other cpt ?

    Thread Starter whatspauldoing

    (@whatspauldoing)

    Nope, no woo.

    I’ll have a check for posts with those names.

    Thanks again.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    when the plugin creates ghost posts these are shown as either with blank thumbnails and no title, or as duplicate of existing posts.

    If you ghost posts are neither of the above, then I reckon they are actual posts which you are not aware of.

    Please see if you can identify those posts (search the title column in the wp_posts table in your DB). If you’re still stuck get back to me on this thread.

    Thread Starter whatspauldoing

    (@whatspauldoing)

    It looks like crc32 and adler32 are something to do with checksum, although I’ll need to look up what that is.

    Could it be to do with my hosts doing some security bits?

    Cheers,

    Paul

    Plugin Author Aurovrata Venet

    (@aurovrata)

    Are you saying that you found those posts in your wp_posts table?

    Thread Starter whatspauldoing

    (@whatspauldoing)

    No, I’m afraid there’s nothing there with those as IDs.

    But what I’m seeing if I add console.log(idx); to the above javascript function is a list of post ID’s followed by the 2 extra entries: crc32 and adler32.

    Cheers,

    Paul

    Plugin Author Aurovrata Venet

    (@aurovrata)

    is a list of post ID’s followed by the 2 extra entries: crc32 and adler32.

    are you saying that your console outputs something like,

    201
    202
    203
    crc32
    adler32

    Thread Starter whatspauldoing

    (@whatspauldoing)

    Yes, exactly.

    Thanks again,

    Paul

    Plugin Author Aurovrata Venet

    (@aurovrata)

    can you check your wp_postmeta table and search for a row with meta_key=’_rpwc2′ and post_id=’crc32′.

    if you find them, delete them, else these are coming from your code, and we will need to explore further.

    Thread Starter whatspauldoing

    (@whatspauldoing)

    ok, I’m seeing a few row in wp_postmeta with post_ids of ‘0’.

    Should I delete those?

    Paul

    Plugin Author Aurovrata Venet

    (@aurovrata)

    ok, I’m seeing a few row in wp_postmeta with post_ids of ‘0’.

    yes

    PS: apologies for replying so late!

    Plugin Author Aurovrata Venet

    (@aurovrata)

    A number of bugs have been fixed in v2.5 which should have resolved this ghost posts problem. I am assuming these are resolved now, but should you still have issues then do get back to me on this thread and I will reopen it.

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

The topic ‘2 Undefined posts at the bottom’ is closed to new replies.