Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

Reblog Button doesn't show up on Latest Posts page. #62651

Closed KirkwallDay closed 1 year ago

KirkwallDay commented 2 years ago

Quick summary

The reblog button will not show up on posts displayed on the latest posts page. This happens on Espied, Independent Publisher 2, and Twenty Twenty

Steps to reproduce

  1. Start a simple site (Reblog is not available on Atomic sites)
  2. Make sure reblog is set in Tools > Marketing > Sharing Buttons
  3. Make your homepage latest posts
  4. View the homepage

What you expected to happen

I was expecting to see all the sharing buttons including the reblog button.

What actually happened

Reblog button is missing, other sharing buttons including like are visible.

Context

Customer Report: 4936961-zen

Simple, Atomic or both?

Simple

Theme-specific issue?

Seems to occur on every theme. Here's the ones I tested:

Espied, TwentyTwenty, Independent Publisher

Browser, operating system and other notes

No response

Reproducibility

Consistent

Severity

Most (> 50%)

Available workarounds?

No but the platform is still usable

Workaround details

No response

kerrynicl commented 2 years ago

Was able to reproduce Reblog button not showing on front page

Markup 2022-04-19 at 09 02 51 Markup 2022-04-19 at 09 04 22
zaguiini commented 2 years ago

Apparently reblogging on non-single post views (index, archive) is disabled: 6786-wpcom has more information about it. I'll see if the blockers are still there and perform changes as needed.

zaguiini commented 2 years ago

The reason it was disabled was that the reblogging UI was not ready to work on pages with multiple posts.

In my tests, I:

It worked fine. However, when I:

The reblogging form that open was related to the topmost post, not the second on the page.

We will need to adapt the reblogging UI script to achieve what we want here.

I will unassign this from me since I have more important things to do right now. Here's a WIP diff that re-enables the Reblog button on the index page: D82365-code

kozer commented 1 year ago

This is a bit complicated, and maybe it will expand, so I leave this for now However, those are my findings while working on this, in order to make life easier to the next person that will grab this:

// enable reblogs if we're on a single post page if ( document.body.classList.contains( 'single' ) ) { JetpackLikesPostMessage( { event: 'reblogsEnabled' }, window.frames[ 'likes-master' ] ); }

Note that this file is fusioned.
- The form that appears on reblog button click is located in the file `reblogging.php` (`wpr_reblog_form` function)
- We definitely need to check the display of the form. This is done in `wpr_load_ajax_js` function
- This code:
// Disable for non-single post views (index, archive). See #6786-wpcom.
if ( ! $is_singular ) {
    $retval = false;
}

in `wpr_page_is_rebloggable` needs to be removed for the js to not blow up on pressing the reblog button in multi post pages.
- This ticket was originally opened 8y ago 6786-wpcom
- In the `master.html`, most probably, we need to add the `post_id` as a parameter to the template (It's available in `likes-rest-nojquery.js` file, so this is an easy thing to do)
- The "singular" (post) check is happening in several places inside `reblogging.php`, so we need to be careful about that. We need to check what the implications may be removing those lines from there.
- Check D82365-code to get some more context. It will help
github-actions[bot] commented 1 year ago

Support References

This comment is automatically generated. Please do not edit it.

danielbachhuber commented 1 year ago

We landed a few fixes for this today:

This should be fixed! ⚒️