Alphabetical pagination (ABP2) [Deleted]

@au lait @Xon

Thanks for reviving this!

Just wanted to note, though, that there's a conflict between this and Xon's Optimized List Queries addon:


XF\Db\Exception: MySQL statement prepare error [1052]: Column 'lft' in where clause is ambiguous in src/XF/Db/AbstractStatement.php at line 228
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
  5. XF\Db\AbstractAdapter->query() in src/XF/Mvc/Entity/Finder.php at line 1379
  6. XF\Mvc\Entity\Finder->fetch() in src/addons/SV/OptimizedListQueries/XF/Repository/Node.php at line 63
  7. SV\OptimizedListQueries\XF\Repository\Node->getNodeList() in src/addons/SV/AggregatingForums/XF/Repository/Node.php at line 44
  8. SV\AggregatingForums\XF\Repository\Node->getAggregableNodeList() in src/addons/SV/AggregatingForums/XF/Repository/Node.php at line 74
  9. SV\AggregatingForums\XF\Repository\Node->getNodeList() in src/XF/Pub/Controller/Forum.php at line 253
  10. XF\Pub\Controller\Forum->actionForum() in src/addons/AVForums/PrefixEssentials/XF/Pub/Controller/Forum.php at line 42
  11. AVForums\PrefixEssentials\XF\Pub\Controller\Forum->actionForum() in src/addons/xenMade/STFRT/XF/Pub/Controller/Forum.php at line 55
  12. xenMade\STFRT\XF\Pub\Controller\Forum->actionForum() in src/addons/xenMade/ABP/XF/Pub/Controller/Forum.php at line 33
  13. xenMade\ABP\XF\Pub\Controller\Forum->actionForum() in src/addons/SV/AggregatingForums/XF/Pub/Controller/Forum.php at line 34
  14. SV\AggregatingForums\XF\Pub\Controller\Forum->actionForum() in src/addons/SV/OptimizedListQueries/XF/Pub/Controller/Forum.php at line 31
  15. SV\OptimizedListQueries\XF\Pub\Controller\Forum->actionForum() in src/XF/Mvc/Dispatcher.php at line 350
  16. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  17. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  18. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  19. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2326
  20. XF\App->run() in src/XF.php at line 488
  21. XF::runApp() in index.php at line 20
 
Try disabling "Fetch all the nodes at once instead of per-type" to see if that helps. It sounds like the lft field is being referred to without a scoping table reference, this will cause issues if joining to a table with a column with that name.

This line;
PHP:
$where[] = ' (lft > ' . $node['lft'] . ') AND (rgt < ' . $node['rgt'] . ') OR ' . 'xf_node.node_id = ' . $node['node_id'];
Should be;
PHP:
$lftColumn = $data->columnSqlName('lft');
$rgtColumn = $data->columnSqlName('rgt');
$where[] = ' ('.$lftColumn .' > ' . $node['lft'] . ') AND ('.$rgtColumn  .'< ' . $node['rgt'] . ') OR ' . 'xf_node.node_id = ' . $node['node_id'];

The add-on should use columnSqlName to correctly get the table/column name.
 
Last edited:
Top Bottom