You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Load book slugs onto these models by default during query-time
static::addGlobalScope('book_slug', function (Builder$builder) {
$builder->addSelect(['book_slug' => function ($builder) {
$builder->select('slug')
->from('books')
->whereColumn('books.id', '=', 'book_id');
}]);
});
The addSelect, where no current selection exists, auto selects all columns.
This is leading to way too much data being loaded in where we're trying to be selective, like almost any loading of pages/chapters for lists.
Need to ideally make this select work with others, or otherwise find another route for this.
Will require attention to be payed to what fields are being returned in API responses, as this could now potentially be a backward compatibility break. Relevant to all endpoints showing chapters/pages, maybe including those on parent items (books->show).
The text was updated successfully, but these errors were encountered:
Removes page/chpater addSelect global query, to load book slug, and
instead extracts base queries to be managed in new static class, while
updating specific entitiy relation loading to use our more efficient
MixedEntityListLoader where appropriate.
Related to #4823
Specifically:
BookStack/app/Entities/Models/BookChild.php
Lines 25 to 32 in 16af833
The
addSelect
, where no current selection exists, auto selects all columns.This is leading to way too much data being loaded in where we're trying to be selective, like almost any loading of pages/chapters for lists.
Need to ideally make this select work with others, or otherwise find another route for this.
Will require attention to be payed to what fields are being returned in API responses, as this could now potentially be a backward compatibility break. Relevant to all endpoints showing chapters/pages, maybe including those on parent items (books->show).
The text was updated successfully, but these errors were encountered: