
93 Cal.App.3d 69 (1979)
155 Cal. Rptr. 482
MATTHEW STEVENS et al., Plaintiffs and Appellants,
v.
E. PAUL PERKINS et al., Defendants and Respondents.
Docket No. 42457.
Court of Appeals of California, First District, Division Two.
May 17, 1979.
*71 COUNSEL
Athearn, Chandler & Hoffman and Richard Harrington for Plaintiffs and Appellants.
Stephen H. Kaufmann and Todd C. Hedin for Defendants and Respondents.
OPINION
TAYLOR, P.J.
Matthew Stevens et al., the incorporating directors of the Marin City First Missionary Baptist Church (Church), appeal from a judgment of dismissal entered on an order sustaining without leave to amend the demurrer of E. Paul Perkins, the pastor, and several other members (collectively Perkins), to their petition filed pursuant to Corporations Code section 709, to determine the results of an election of directors. (1a) For the reasons set forth below, we have concluded that former Corporations Code sections 2236-2238[1] have residual application to nonprofit corporations and were available to determine the validity of a corporate election. Accordingly, the petition can be amended to state a cause of action, and the judgment must be reversed.
The Church is a charitable nonprofit corporation organized in 1956 pursuant to title 1, division 2, of the General Nonprofit Corporation Law (former Corp. Code, § 9000 et seq.) enacted in 1947. On June 10, 1976, at a special meeting of the directors of the Church held in San Francisco, *72 two of the Church's directors and seven acting directors voted to amend article V of the articles of incorporation to provide for a total of nine rather than five directors.[2] Thereafter, the seven acting directors were elected to fill the vacancies created by this amendment. At the same meeting, the nine newly elected directors voted to remove the pastor from his position.
Over a year later, on June 24, 1977, the directors filed the instant petition to determine results of election, pursuant to Corporations Code section 709.[3] Perkins' general demurrer was sustained without leave to amend as the trial court concluded that the language of Corporations Code section 709, subdivision (a) requires that a plaintiff be denied the right to vote in a corporate election before the remedy described by section 709, subdivision (c) is available. The exhibits and verified complaint indicated that the directors voted in the June 1976 election, although that election has apparently not been recognized by Perkins or the congregation of the Church.
We agree with the trial court that Corporations Code section 709 is inapplicable to the situation at hand, but we believe that the petition could be amended to state a cause of action pursuant to former Corporations Code section 2236 et seq., which sections, despite the 1977 repeal, have a continuing application to nonprofit corporations.
*73 (2) On appeal from a judgment of dismissal after a general demurrer has been sustained, the reviewing court must treat all facts properly pleaded as admitted and must liberally construe the allegations with a view to obtaining substantial justice among the parties (117 Sales Corp. v. Olsen, 80 Cal. App.3d 645, 648 [145 Cal. Rptr. 778]). In addition, "we are not limited to plaintiffs' theory of recovery ... but instead must determine if the factual allegations of the complaint are adequate to state a cause of action under any legal theory" (Barquis v. Merchants Collection Assn., 7 Cal.3d 94, 103 [101 Cal. Rptr. 745, 496 P.2d 817]; Johnson v. Harcourt, Brace, Jovanovich, Inc., 43 Cal. App.3d 880, 886 [118 Cal. Rptr. 370]).
As indicated above, the instant petition filed on June 24, 1977, was based on a part of the revised General Corporation Law which became effective on January 1, 1977. (3) Generally, the repeal of a statute terminates the right to maintain an action where no rights have vested previously (International etc. Workers v. Landowitz, 20 Cal.2d 418 [126 P.2d 609]). However, the statute enacting the revised General Corporation Law expressly stated that the former General Corporation Law (former Corp. Code, § 100 et seq.) would apply to private corporations formed under other statutes unless and until those statutes are amended to provide otherwise (Stats. 1975, ch. 682, § 16; Stats. 1976, ch. 641, § 43.5). Accordingly, the former law continued to apply to nonprofit corporations pursuant to former Corporations Code section 119, as set forth below,[4] and Corporations Code section 9002[5] except as otherwise specifically provided in the General Nonprofit Corporation Law.
*74 The instant controversy hinges on whether the 1977 version of the code or its predecessor was applicable to nonprofit corporations. (1b) Corporations Code section 102[6] excludes nonprofit corporations from the scope of the newly enacted General Corporation Law.
On the basis of the express language of these enactments, we can only conclude that the Legislature intended the former General Corporation Law to have continuing application to nonprofit corporations, in spite of its repeal. Our conclusion is strengthened by the Legislature's subsequent repeal of the former nonprofit corporation law and enactment of a new nonprofit corporation law (beginning with § 5000, operative Jan. 1, 1980; Stats. 1978, chs. 567 and 1305). Thus, a cause of action based on new Corporations Code section 709 is clearly precluded, and the trial court was correct in sustaining Perkins' demurrer on that ground.
However, we believe that the petition may be amended to state a cause of action pursuant to former Corporations Code sections 2236-2238.[7] Accordingly, the directors should be given the opportunity to amend.
*75 Preliminarily, we dispose of Perkins' contention that the remedy of the former statutes is available to "shareholders" only and since the Church is a nonstock corporation,[8] it has no shareholders, but only members. There is no merit in this contention. (4) Former Corporations Code section 103[9] expressly indicates that members of a nonstock corporation are shareholders for purposes of the Corporations Code.
(5) Logic requires that the remedy provided by former sections 2236-2238, must be available to those seeking to uphold a corporate election as well as to those who seek to oppose the election. The statutory language merely authorizes the superior court to "determine the validity of any election or appointment of any director...." We can find no authority which purports to restrict the application of this statute to challenges alone. Accordingly, we hold that "substantial justice" requires that the plaintiffs be given the opportunity to amend their complaint.
The directors also argue that the trial court erred in failing to treat their petition alternatively as an action for declaratory relief. We need not discuss this contention in view of our conclusion that a cause of action under the Corporations Code is available. (6) We note, however, that Code of Civil Procedure section 1061 clearly allows the trial court broad discretion in granting declaratory relief.[10] In view of our conclusion, the trial court may also wish to reconsider its ruling as to declaratory relief.
The judgment is reversed with leave to file an amended petition.
Kane, J., and Rouse, J., concurred.
NOTES
[1]  Repealed effective December 31, 1976.
[2]  Article X of the articles of incorporation provides that such an amendment requires the approval of a majority of the membership of the Church.
[3]  Corporations Code section 709 (effective Jan. 1, 1977) was formerly Corporations Code section 2236. The statute provides:

"(a) Upon the filing of an action therefor by any shareholder or by any person who claims to have been denied the right to vote, the superior court of the proper county shall try and determine the validity of any election or appointment of any director of any domestic corporation, or of any foreign corporation if the election was held or the appointment was made in this state. In the case of a foreign corporation the action may be brought at the option of the plaintiff in the county in which the corporation has its principal office in this state or in the county in which the election was held or the appointment was made.
"(b) Upon the filing of the complaint, and before any further proceedings are had, the court shall enter an order fixing a date for the hearing, which shall be within five days unless for good cause shown a later date is fixed, and requiring notice of the date for the hearing and a copy of the complaint to be served upon the corporation and upon the person whose purported election or appointment is questioned and upon any person (other than the plaintiff) whom the plaintiff alleges to have been elected or appointed, in the manner in which a summons is required to be served, or, if the court so directs, by registered mail; and the court may make such further requirements as to notice as appear to be proper under the circumstances.
"(c) The court may determine the person entitled to the office of director or may order a new election to be held or appointment to be made, may determine the validity, effectiveness and construction of voting agreements and voting trusts, the validity of the issuance of shares and the right of persons to vote and may direct such other relief as may be just and proper." (Italics added.)
[4]  When former section 119 was repealed, the following saving clause was enacted:

"(a) Section 119 of the Corporations Code as in effect immediately prior to the effective date of this act, to the extent that it makes applicable the General Corporation Law to private corporations organized under other laws, shall continue in effect notwithstanding its repeal by the provisions hereof; but it shall refer to the provisions of Division 1 (commencing with Section 100) of Title 1 of the Corporations Code as in effect immediately prior to the effective date of this act, unless and until the provisions of any other statute permitting the incorporation of private corporations shall be amended to incorporate by reference in such other statute specific sections or portions of Division 1 (commencing with Section 100) of Title 1 of the Corporations Code as amended hereby. All references in any such other statute to any sections or portions of the General Corporation Law shall, until such amendment, continue to be references to Division 1 (commencing with Section 100) of Title 1 of the Corporations Code as in effect immediately prior to the effective date of this act....
"(b) Notwithstanding subdivision (a), subdivision (b) of Section 201 of the Corporations Code as in effect on January 1, 1977, and as subsequently amended, shall apply to all corporations." (Stats. 1975, ch. 682, § 16, p. 1626, amended by Stats. 1976, ch. 641, § 43.5, p. 1578.) (Italics added.)
[5]  Section 9002: "The provisions of the General Corporation Law, Division 1 of this title, apply to corporations formed under this part, except as to matters specifically otherwise provided for in this part" (italics added).
[6]  "(a) Subject to the provisions of Chapter 23 (commencing with Section 2300) (transition provisions), the provisions of this division apply to corporations organized under this division and to domestic corporations which are not subject to Division 2 (commencing with Section 9000) or Part 1 (commencing with Section 12000), 2 (commencing with Section 12200), 3 (commencing with Section 13200), 5 (commencing with Section 14000) or 6 (commencing with Section 14200) of Division 3 of this title on December 31, 1976, and which are not organized or existing under any statute of this state other than this code; they apply to any other corporation only to the extent expressly included in a particular provision of this division.

"(b) The existence of corporations formed or existing on the date of enactment or reenactment of this division shall not be affected by the enactment or reenactment of this division nor by any change in the requirements for the formation of corporations nor by the amendment or repeal of the laws under which they were formed or created.
"(c) Neither the repeals effected by the enactment or reenactment of this division nor the enactment of this title nor the amendment thereof shall impair or take away any existing liability or cause of action against any corporation, its shareholders, directors or officers incurred prior to the time of such enactment reenactment or amendment." Added Statutes 1975, chapter 682, section 7, effective January 1, 1977; Amended Statutes 1976, chapter 641, section 1.3, effective January 1, 1977. (Italics added.)
[7]  Former section 2236 provides: "Upon the filing of an action therefor by any shareholder, the superior court shall try and determine the validity of any election or appointment of any director of any domestic corporation, or of any foreign corporation if the election was held or the appointment was made in this State. In the case of a domestic corporation the action shall be brought in the county in which the principal office of the corporation is located. In the case of a foreign corporation the action shall be brought in the county in which the corporation has its principal office in this State or in which the election was held or the appointment was made."

Former section 2237 provides: "Upon the filing of the complaint, and before any further proceedings are had, the court shall enter an order fixing a date for the hearing, which shall be within five days unless for good cause a later date is fixed, and requiring notice of the date for the hearing and a copy of the complaint to be served upon the corporation and upon the person whose purported election or appointment is questioned and upon any person (other than the plaintiff) whom the plaintiff alleges to have been elected or appointed, in the manner in which a summons is required to be served, or if the court so directs, by registered mail; and the court may make such further requirements as to notice as appear to be proper under the circumstances."
Former Corporations Code section 2238 provides: "The court may determine the person entitled to the office of director or may order a new election to be held or appointment to be made, and direct such other relief as may be just and proper."
[8]  Articles VII and VIII of the Church articles of incorporation.
[9]  Section 103: "`Shareholder' or `stockholder' or `holder of shares' means `holder of record of shares' or `shareholder of record' and includes a subscriber to shares in cases in which no certificates are outstanding, and a member of a nonstock corporation." (Italics added.)
[10]  "The court may refuse to exercise the power granted by this chapter in any case where its declaration or determination is not necessary or proper at the time under all the circumstances." (Added Stats. 1921, ch. 463, § 1, p. 690.)
