Notwithstanding Section 15-16-20, Code of Alabama 1975, if a commitment order has been issued pursuant to Title 22, Chapter 52, Code of Alabama 1975, but cannot be fulfilled because the respondent is subsequently confined solely for misdemeanor charges or municipal ordinance violations, the judge of probate who issued the commitment order may communicate with the judge of the district, municipal or circuit court who ordered the respondent to be confined to discuss whether he or she will issue an order to discharge the respondent from confinement and suspend the criminal proceedings temporarily so that the commitment order may be fulfilled. The court shall give the prosecuting attorney an opportunity to object to the discharge order.
Ala. Code § 15-16-26 (1975)