Skip to content

ListElementNeighbors returns elements at all found positions on all parents

One of the bugs discovered from looking into requests#1:

Assuming the following structure:

  • Folder A
    • Page A1
    • Page X
    • Page A3
    • Page A4
    • Page A5
    • Page A6
  • Folder B
    • Page B1
    • Page B2
    • Page B3
    • Page B4
    • Page X
    • Page B6

Page X is in both folders; ListElementNeighbors for X should, in theory, return X twice with different parents (X in A, X in B) as well as the previous and next page on both parents: A1 and A3, and B4 and B6. In reality, it currently would return all of the above pages! There is a missing JOIN…ON condition in the SQL query.

Edited by Erwan Rouchet