I was implementing the cross thread references code on my installation of pyib, and found that the database query can potentially return the wrong result due to the fact that boardid is not specified in the WHERE clause, breaking the link.
The fix is very simple:
in formatting.py:
Old (broken) Code:
line 119: parentid = FetchOne("SELECT parentid FROM posts WHERE id = '%s' LIMIT 1" % postid)["parentid"]
New (fixed) Code
line 119: parentid = FetchOne("SELECT parentid FROM posts WHERE id = '%s' AND boardid = '%s' LIMIT 1" % (postid, board['id']))["parentid"]
I was implementing the cross thread references code on my installation of pyib, and found that the database query can potentially return the wrong result due to the fact that
boardid
is not specified in the WHERE clause, breaking the link.The fix is very simple:
in formatting.py:
Old (broken) Code: line 119: parentid = FetchOne("SELECT
parentid
FROMposts
WHEREid
= '%s' LIMIT 1" % postid)["parentid"]New (fixed) Code line 119: parentid = FetchOne("SELECT
parentid
FROMposts
WHEREid
= '%s' ANDboardid
= '%s' LIMIT 1" % (postid, board['id']))["parentid"]Regards, Dunecat