Skip to content

Fetch all potential categories, attachments, and tags #10873

Closed

Description

@danielbachhuber

There are a few API fetch instances using per_page=100 that should instead fetch all of their items:

  1. getAttachmentsCollection() in packages/edit-post/src/hooks/components/media-upload/index.js: 0a08388

  2. The following code in FlatTermSelector: Fetch all terms linked to a post, rather than just first 100 #11524

this.initRequest = this.fetchTerms( {
	include: this.props.terms.join( ',' ),
	per_page: 100,
} );

Even though it's unlikely a user will have 101 tags, Gutenberg will silently discard their 101st tag as fetchTerms() is currently implemented.

  1. componentWillMount() in packages/block-library/src/latest-posts/edit.js: Run the E2E tests as a user with the author role #11359 (comment)

From https://github.com/WordPress/gutenberg/pull/10762/files/8803b88e7e7eed8f73aba32b52608175b1a2e858#diff-781b45da3dbed5d2670d2c98e473fb83

Activity

  1. added
    [Type] Bug
    [Package] Core data
    on Oct 21, 2018
  2. added this to the 4.2 milestone on Oct 21, 2018
  3. modified the milestones: 4.2, WordPress 5.0 on Oct 26, 2018
  4. changed the title [-]Fetch all potential attachments and tags[/-] [+]Fetch all potential categories, attachments, and tags[/+] on Nov 5, 2018
  5. dd32 commented on Nov 6, 2018

    @dd32
    Member

    #11524 is me testing out the changes needed here.

    I've verified that Item 2 in FlatTermSelector was indeed an issue, and patched that.

    I've been looking into Item 1, but I've been struggling to actually trigger the problematic code.

  6. danielbachhuber commented on Nov 9, 2018

    @danielbachhuber
    MemberAuthor

    I've been looking into Item 1, but I've been struggling to actually trigger the problematic code.

    @dd32 This has some fun origins:

    I think what getAttachmentsCollection() is meant to do is prime the attachment data used in the Media Library. I also believe that, if the attachment data is missing, the Media Library will refetch it.

    @joemcgill Does this match your understanding?

  7. danielbachhuber commented on Nov 12, 2018

    @danielbachhuber
    MemberAuthor

    The two remaining issues were addressed in #11654 and #11655

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    REST API Interaction[Package] Core data[Type] Bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions