Fix repo not found error for patches
Created by: eseliger
Closes #9641 once again. Oversaw that patches actually are also connected to repos and we needed to make similar adjustments to these queries as well.
Created by: eseliger
Closes #9641 once again. Oversaw that patches actually are also connected to repos and we needed to make similar adjustments to these queries as well.