Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pagination work on photo album overview page #1838

Merged
merged 1 commit into from
Nov 27, 2020

Conversation

githubertus
Copy link
Contributor

and display profile picture album and profile cover only on page 1

and display profile picture album and profile cover only on page 1
@githubertus
Copy link
Contributor Author

githubertus commented Nov 26, 2020

Actually, I'm not quite happy with the hardcoded page limit in photos
Maybe it's better to get the value from the hook instead.

But the real problem is:
GetAlbums() is calling getObjectByOwner()
and getObjectByOwner() is setting page_limit to something empty
Now when getObjectByOwner() is calling searchObject()
the array_merge($default, $params); will overwrite the $defaults array page_limit (of 10) with the empty $params page_limit
leading to a crash finally.
see array_merge doc: "...If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. ...."

So, as long as you don't want to make any changes to Ossn_Objects, the page_limit must be set BEFORE calling getObjectByOwner(), as in this case via GetAlbums()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants