remove todos: BookManager::loadBooks() should sort books by weight, title
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3556637. -->
Reported by: [damienmckenna](https://www.drupal.org/user/108450)
Related to !144 !139
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The books listed by BookManager::loadBooks() currently lists the books in whatever order the database decides to return them. This is a break from the D7 logic which sorted as follows:</p>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br> $query</span><span style="color: #007700">-></span><span style="color: #0000BB">orderBy</span><span style="color: #007700">(</span><span style="color: #DD0000">'ml.weight'</span><span style="color: #007700">);<br> </span><span style="color: #0000BB">$query</span><span style="color: #007700">-></span><span style="color: #0000BB">orderBy</span><span style="color: #007700">(</span><span style="color: #DD0000">'ml.link_title'</span><span style="color: #007700">);<br></span><span style="color: #0000BB">?></span></span></pre></div>
<p>The module code also has this comment:</p>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br> </span><span style="color: #FF8000">// @todo Sort by weight and translated title.<br></span><span style="color: #0000BB">?></span></span></pre></div>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Add logic to BookManager::loadBooks() to sort books by weight and then title.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>Add logic to BookManager::loadBooks() to sort books by weight and then title.</p>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>Books listed by BookManager::loadBooks() will be sorted by weight then title.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>TBD</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>TBD</p>
issue