Wp-calypso: Editor: Link to existing content includes results for non-public post types

Created on 21 Apr 2016  Â·  19Comments  Â·  Source: Automattic/wp-calypso

Steps to reproduce:

  1. Ensure at least one published "Feedback" exists, which can be managed from WP-Admin under Feedback > Feedback
  2. Navigate to the post editor
  3. Select a site, if prompted
  4. Click Add Link from the editor toolbar

Expected result:

Feedback should not be included in results since the post type is not public.

Actual result:

Feedback results are included.

Suspected cause:

The WP-Admin editor only queries link results for post types which are registered as public. The Calypso editor link dialog queries for any post type.

Further, this will likely require additional functionality from the REST API to either (a) allow querying a list of posts for public post types or (b) allow querying a list of posts for a comma-separated list of types. Currently you can only specify a single type or any from the GET /sites/%s/posts endpoint. If we change this to accept a comma-separated list of types, we'll need to enhance the editor to first retrieve public post types before displaying the selector results.

Editor [Type] Bug

Most helpful comment

I'm able to easily confirm this and I'll be working on fix in #11887

All 19 comments

bug-scrub

Tested and confirmed using the steps provided:

screen shot 2016-07-20 at wed jul 20 3 04 05 pm
Seen at https://design5279.wordpress.com/wp-admin/edit.php?post_type=feedback using Safari 9.1.1 on Mac OS X 10.11.5

screen shot 2016-07-20 at wed jul 20 3 03 57 pm
Seen at https://wordpress.com/post/design5279.wordpress.com using Safari 9.1.1 on Mac OS X 10.11.5

This looks still valid — changing the query from "any" to only "public" post types should be a simple change, right?

@lancewillett : REST API support does not exist for querying public types. Also not something that can be achieved by outside contributors (except by Jetpack -> WordPress.com sync).

Removing the Good First Change label since this actually requires a change to the REST API to remove posts of type 'feedback' from returning when posts are queried (or a way to only return posts||pages but not feedback)

Had an user complaining about this: #2997984-t

He has lots of feedbacks, then that's what he sees when trying to add a link:

a9ea3be58-d7d7-11e6-8ec0-d9f0ba11581f

Any updates on this issue? I have another customer asking about it in 2813042-t

138461-chat

Another issue/report in 44037-hc

As a related improvement, might also be worth a look at a toggle to show and hide the "Link to existing content" menu, as it can get long sometimes.

toggle to show and hide

Cancel that — I've tried it more, and the view does scroll once the list gets longer.

Same error on #3093955-t
I was able to replicate it, and since the user has a lot of feedback, it is pretty notorious.

I'm able to easily confirm this and I'll be working on fix in #11887

+1 on #3140762-t with some SPAM comments:
screen shot 2017-04-04 at 12 35 09 pm

User report in 334463-hc

This is now live in production for all dotcom sites. Jetpack support will be coming later (reopening because of that). It would need to be a part of JP release, as it touches backend logic.

Can we contact those people who reported the issue to us and have dotcom sites?

Can we contact those people who reported the issue to us and have dotcom sites?

Done in 2997984-t, 2813042-t, 3235835-t, 3235836-t, 3093955-t, 31407620-t, 3235837-t.

This is now fixed for all dotcom sites and Jetpack sites with plugin version 5.0 and newer.

Nice work @marekhrabe and Team Samus! ✊

Tested and re-confirmed the fix on WordPress.com. :)

screen shot 2017-06-23 at fri jun 23 12 25 04 pm
Seen at https://design5279.wordpress.com/wp-admin/edit.php?post_type=feedback using using Firefox 54.0 on Mac OS X 10.12.5.

screen shot 2017-06-23 at fri jun 23 12 32 15 pm
Seen at https://wordpress.com/post/design5279.wordpress.com/11195 using Firefox 54.0 on Mac OS X 10.12.5.

Was this page helpful?
0 / 5 - 0 ratings