fetchPage not working in current version
See original GitHub issueWe tried using fetchPage instead of fetch or fetchAll.
The default {page: 1, pageSize: 10} is returned.
However if we try including withRelated or different page and pageSize options it continues to return the default and does not work correctly. Anyone else experiencing this?
Here’s what a part of our code looks like:
fetchForCriteria: function (criteria) {
return this.query(function (q) {
for (var param in criteria) {
if (criteria[param] == null || criteria[param] == undefined || criteria[param] == "")
continue;
if (param == 'orderby') {
// q.orderBy(criteria[param], criteria['direction'] || 'desc');
}
else if (param == 'direction') {
continue;
}
else if (param == 'brand_id') {
continue;
}
else if (param == 'list_id') {
continue;
}
else if (param == 'image_id') {
continue;
}
else if (param == 'filter') {
var offer_ids = JSON.parse(criteria[param]);
if (offer_ids.length > 0) {
q.whereIn('id', offer_ids);
}
}
else if (param == 'name' || param == 'description' || param == 'requirements') {
q.where(param, 'ilike', '%' + criteria[param] + '%');
}
else {
q.where(param, '=', criteria[param]);
}
}
})
.orderBy('name')
.fetchPage({ // fetchPage // Not working for some reason
page: 2,
pageSize: 5,
withRelated: ['lists', 'brands', 'status', 'offerType', 'images']
});
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Fetch page data in background while returning current page
Issue is currently pull data calls both function sequentially and then returns, which makes UI to wait for the data. I want it...
Read more >Bug#1009914: telegnome does not fetch page images
one of the latest updates of dependent packages telegnome does not work any more. The only message I get is: WARNING **: 17:01:40.546:...
Read more >API Reference - Bookshelf.js
Automatically sets the current date and time on the timestamp attributes ... If the table you're working with does not have a Primary-Key...
Read more >How to fetch Page Properties in JS in AEM 6.2
It would not work in any JS file like this. ... If you're looking to do this in the current version of AEM,...
Read more >Troubleshooting WordPress Plugin Technical Issues
Domain is Authorized; Can Fetch Page Listing; Supported PHP Version; Supported Wordpress Version. 4. If any of the above checks have an 'X'...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Will be very useful if the @vellotis PR will be accepted. I’m having this problem.
fetchPage()
also seems to be broken for me on bookshelf v0.9.5Works fine:
Doesn’t work:
Only difference is
fetchAll()
vs.fetchPage()