In such actions all persons whose liens are filed as herein provided, and other encumbrancers of record, except those encumbrancers whose lien has priority over the claim of the plaintiff, shall be made parties, and issues shall be made and trials had as in other cases. Where such an action is brought by a subcontractor, or person other than the original contractor, such original contractor shall be made a party defendant, and shall at his or her own expense defend against the claim of every subcontractor, or other person claiming a lien under this article, and if he or she fails to make such defense the owner may make the same at the expense of such contractor; and until all such claims, costs and expenses are finally adjudicated, and defeated or satisfied, the owner shall be entitled to retain from the contractor the amount thereof, and such costs and expenses as he or she may be required to pay. If the sheriff of the county in which such action is pending shall make return that he or she is unable to find such original contractor, the court may proceed to adjudicate the liens upon the land and render judgment to enforce the same with costs.
K.S.A. 60-1106