All assignments of mortgages at present existing, bearing date prior to the taking effect of this act, shall within four months next succeeding the taking effect of this act be recorded in the proper county of this state, in accordance with the provisions of K.S.A. 58-2319, whether such assignments be acknowledged or not; and in case such assignments are not recorded within the time herein provided, the payment of any interest or principal on the debts secured by such mortgages to the mortgagees or the assignees whose assignments appear last of record after the expiration of the time herein provided, and before the recording of such assignments, shall be and constitute a complete defense to any action on such mortgage or note or other evidence of indebtedness secured thereby as against the mortgagor, his or her heirs, personal representatives, or assigns: Provided, however, That the last assignee of an unrecorded assignment shall have a right of action against the assignor to whom such interest or principal is paid: And provided further, That where the mortgagor, his or her heirs, personal representatives or assigns have actual notice or knowledge of such assignment or transfer, then in such case such payment shall constitute no defense, and none of the provisions of this act shall apply.
K.S.A. 58-2322