In any action brought to challenge the validity of the general plan of any city, county, or city and county, or any mandatory element thereof, if the court, in a final judgment in favor of the plaintiff or petitioner, finds that the general plan or any mandatory element of the general plan does not substantially comply with the requirements of Article 5 (commencing with Section 65300):
Notwithstanding the provisions of subdivision (b) of Section 65585, the planning agency of the city, county, or city and county shall submit a draft of its revised housing element or housing element amendment at least 45 days prior to its adoption to the Department of Housing and Community Development for its review, notifying the department that the element is subject to the review procedure set forth in this section.
The department shall review the draft element or amendment and report its findings to the planning agency within 45 days of receipt of the draft. The legislative body shall consider the department's findings prior to final adoption of the housing element or amendment if the department's findings are reported to the planning agency within 45 days after the department receives that draft element or amendment.
Ca. Gov. Code § 65754