Netlify-cms: Bitbucket backend, pagination not working.

Created on 15 Jan 2019  Â·  14Comments  Â·  Source: netlify/netlify-cms

Describe the bug
The number of item fetched from the bitbucket backend is capped and the pagination does not happen.

To Reproduce
Steps to reproduce the behavior.

  1. Use the default configuration file.
  2. Change backend to bitbucket and connect to a test repo containing (at minimum):

    • One folder called _posts

    • 11 Files in the _postsfolder

  3. Connect to Netlify-CMS and navigate to collection/posts
  4. Only 10 of the 11 files are visible and there are no ways to see the remaining ones.

A search still returns all files.

Screenshots
image
image

Applicable Versions:

  • Netlify CMS version: 2.3.2
  • Git provider: BitBucket
  • Browser version Firefox 64.0.2
  • Node.JS version:

CMS configuration
Default file with:

backend:
  name: bitbucket
  branch: master
  repo: username/reponame
extensionbackends bug pinned

All 14 comments

Can you confirm whether changing to list view fixes it? Still a bug, but wondering if it's specific to the grid view.

Yes I can confirm that it is not specific to the grid view.

Argh can't log in to bitbucket, will follow up once I work things out with their support team.

If you need me to test just let me know @erquhart

Tried with a collection of exactly 11 items, scrolling down loads the 11th item. Tried in grid and list, with Safari and Firefox, with different browser window sizes. Can't reproduce 😕

I can reproduce the issue on Chrome. I don't think it's related to the Bitbucket API per se, but it has to do with how the infinite scrolling pagination is implemented.

For me, the easiest way to reproduce it is to have a window that is roughly as tall as the initial list of content fetched, which is 10 items. Infinite scrolling will work fine on the first page load. Then:

  1. Click on a content entry and navigate into it;
  2. Click on the back button to get back to the collection;
  3. Infinite scrolling is now broken.

I honestly haven't dug in the code, so I'm just guessing here – but I think it's due to how the waypoint trigger element is removed/replaced in the page when navigating in and out of the content editor.

Here's a recording of the reproduction, hoping it clears up what I said: https://gfycat.com/deliciousforsakenhoatzin

Other backends don't use the infinite scrolling pagination (I believe because of the different API design), so it's not a problem for those.

Thanks for digging into that @iprignano, it does seem to be a bug.

@barthc this behaves the same as the bug in #1744, any chance they're the same?

@erquhart I cannot reproduce the gif from my end. @iprignano what's your CMS version?

@barthc I was on 2.1.3 – I didn't try to upgrade before reporting the issue because I didn't see anything related to it in the changelog. My bad! I've updated to 2.4.1 and the behaviour seems fixed now. Thank you and thanks @erquhart for the prompt response.

@G-T-P can you confirm whether this is still an issue for you in 2.4.1 or later?

Thanks all for looking into it.
I retried the original test and the issue was still there so I updated to 2.4.2 and I still see the issue.

I am loading the page through a custom install on nextJS so I tested instead with the simplest set-up:

<link href="path/to/config.yml" type="text/yaml" rel="cms-config-url">
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>

And that fixed the problem. The initial load yields only 10 items but scrolling down does as expected and triggers the fetch of the remaining items.

To give some details on my install set-up:

  1. Admin page in NextJS static page folder
  2. The page contains a dynamic loader which imports (on client build only) the unmodified source code

I suppose that something in the way the infinite scrolling is implemented conflicts with the dynamic loader. What I find strange however is that there are no request whatsoever leaving the page to fetch the extra items. On the "simplest" set-up the request is automatically fired as expected.

EDIT: I wanted to add that I have been using this set-up with the github & test backends without problems.

Interesting - this does sound like a compatibility issue that should be looked into, keeping open.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This should be fixed here https://github.com/netlify/netlify-cms/pull/3216.

Please re-open if issue still persists

Was this page helpful?
0 / 5 - 0 ratings

Related issues

calavera picture calavera  Â·  3Comments

BerkeleyTrue picture BerkeleyTrue  Â·  3Comments

zebapy picture zebapy  Â·  3Comments

noelmace picture noelmace  Â·  3Comments

dur41d picture dur41d  Â·  3Comments