
25 Cal.App.4th 1095 (1994)
31 Cal. Rptr. 44
THE PEOPLE, Plaintiff and Respondent,
v.
RODNEY BECK, Defendant and Appellant. RODNEY BECK, Petitioner,
v.
THE SUPERIOR COURT OF SAN BERNARDINO COUNTY, Respondent; THE PEOPLE, Real Party in Interest.
Docket Nos. E011577, E013045.
Court of Appeals of California, Fourth District, Division Two.
June 9, 1994.
*1097 COUNSEL
James M. Glick and Andrew E. Rubin for Defendant and Appellant and for Petitioner.
Daniel E. Lungren, Attorney General, George Williamson, Chief Assistant Attorney General, Gary W. Schons, Assistant Attorney General, and Jeffrey J. Koch, Deputy Attorney General, for Plaintiff and Respondent and for Real Party in Interest.
No appearance for Respondent.
OPINION
DABNEY, Acting P.J.
Defendant Rodney Beck, pursuant to plea bargain, pleaded guilty to one count of cultivation of marijuana. Thereafter, he moved for return of personal property (firearms), but the court refused to return the property to him, purportedly pursuant to Penal Code section 12028, which declares firearms used in the commission of a crime to be a nuisance and provides for the confiscation and destruction of such firearms.
Defendant orally moved to withdraw his guilty plea, on the ground that he was not informed that confiscation of his personal property would be *1098 imposed as a consequence of his guilty plea. The motion to withdraw his plea was denied. Defendant then filed a notice of appeal and, in addition, a petition for writ of mandate,[1] both seeking (1) return of the personal property and/or (2) reversal of the judgment and permission to withdraw his guilty plea.
We conclude that the property was improperly confiscated. That being the case, there is no reason for defendant to withdraw his plea.

FACTS
On September 24, 1990, the Fontana police were in a foot chase, looking for a suspected auto thief. While searching for the suspected thief, police officers were in a position from which they saw a greenhouse in defendant's backyard. The officers could see numerous marijuana plants growing in the greenhouse.
Defendant, who was home, would not consent to a search of his backyard. Defendant was shortly arrested. The police obtained a telephonic warrant, searched the backyard, and found some marijuana plants growing in an outdoor garden, and over 95 marijuana plants growing in the greenhouse. The police also discovered, among other things, equipment consistent with a methamphetamine laboratory in the garage, $29,000 in mildewed cash and two baggies of methamphetamine stashed in a "yard car," and nine bags of leafy marijuana material in the house.
Defendant was charged with one count of cultivation of marijuana, one count of possession of methamphetamine for sale, and one count of possession of marijuana for sale. (Health & Saf. Code, §§ 11358, 11378, 11359, respectively.) He pleaded guilty to the count of cultivation of marijuana. In exchange, defendant was promised a grant of probation on various terms, including serving 270 days in jail on weekends. Defendant also was to be sentenced by a different judge from the judge who took the plea, and the two remaining counts were to be dismissed. All the recited terms of the bargain were carried out.
Thereafter, defendant moved for the return of personal property; that is, several firearms that had been seized from the house during the arrest and search. The court, invoking Penal Code section 12028, declared that the guns had been used in the commission of a crime and that, upon defendant's *1099 conviction by guilty plea, the firearms were to be retained and destroyed. The court refused to provide defendant a hearing on the matter. Defendant thereupon moved orally to withdraw his guilty plea; that motion was also denied.

DISCUSSION

I. Confiscation of the Firearms

The court below refused to return defendant's firearms and instead confiscated them under the ostensible authority of Penal Code section 12028.

A. The People Were Not Required to Proceed Exclusively Under the Drug-related Asset Forfeiture Provisions.

(1) Preliminarily, we dispose of defendant's argument that, because the firearms were confiscated on the theory that they were "used in the commission of" a drug-related offense, the prosecutor was required to proceed solely by instituting drug-related asset forfeiture proceedings (Health & Saf. Code, §§ 11470-11491).[2]
Defendant argues that Health and Safety Code section 11470 et seq. is a comprehensive statutory scheme relating specifically to forfeiture of assets and weapons which are either used to facilitate or commit drug offenses, or which represent the "spoils" of drug offenses.
By contrast, defendant urges, Penal Code section 12028, the section invoked by the trial court, is an "all-purpose" statute relating to firearms used in the commission of any felony.
Defendant recites the axiom that, where two statutes purport to deal with the same subject matter, the more specific statute will prevail over the more general statute. According to defendant, the drug-related asset forfeiture law is the "specific" statute, which governs over the "general" firearm confiscation statute, Penal Code section 12028. Because defendant's firearms were *1100 confiscated on the theory they were "used in the commission of" drug-related offenses, the prosecutor could only proceed by invoking the drug-asset forfeiture proceedings under the Health and Safety Code.
We do not accept defendant's premise that, in this context, the Health and Safety Code sections are the "more specific" statute. The civil forfeiture proceedings under Health and Safety Code section 11470 et seq., in which the prosecutor must file a complaint and in which a full hearing is provided, apply not only to firearms, but also to any other kinds of weapons used in the commission of drug-related offenses, to any other instrumentalities used to facilitate the drug offenses (such as pagers, cars, telephones), and, indeed, to a broad range of assets which represent the proceeds of drug offenses, including cash, vehicles, and many other kinds of property.
Penal Code section 12028, on the other hand, simply declares that firearms proven to have been used in the commission of a crime are nuisances, and may be destroyed. It applies to a narrow class of cases, and in a narrowly defined circumstance; i.e., where a firearm was used in the commission of the crime. In addition, under Penal Code section 12028, the confiscation of the "nuisance" firearms may take place only "upon conviction;" the drug-related asset forfeiture proceedings under Health and Safety Code section 11470 et seq. do not require a conviction, and do not even require arrest, before such proceedings may be invoked. It thus may very well be that, in its appropriate context, Penal Code section 12028 is the more specific of the two apparently applicable statutes.
The prosecutor therefore was not required to elect the civil drug-related asset forfeiture proceedings under Health and Safety Code section 11470 et seq. Defendant's firearms could properly be declared nuisances and confiscated ("forfeited") under Penal Code section 12028  provided the requirements of that section were otherwise met  notwithstanding that defendant allegedly used the firearms in connection with a drug-related offense.

B. Were Defendant's Firearms a "Nuisance" Under Penal Code Section 12028?

Penal Code section 12028 states in relevant part: "(b) A firearm of any nature ... used in the commission of any misdemeanor as provided in this code, any felony, or an attempt to commit any misdemeanor ... or any felony, is, upon a conviction of the defendant ... a nuisance.
"(c) ... [U]pon conviction of the defendant ..., any weapon described in subdivision (b) shall be surrendered to the sheriff of a county or the chief *1101 of police or other head of a municipal police department of any city or city and county or the Commissioner of the California Highway Patrol.... If any weapon has been stolen and is thereafter recovered from the thief or his or her transferee, or is used in such a manner as to constitute a nuisance pursuant to subdivision ... (b) without the prior knowledge of its lawful owner that it would be so used, it shall ... be restored to the lawful owner, as soon as its use as evidence has been served, upon his or her identification of the weapon and proof of ownership."
The weapons confiscated under this section may, if they have bona fide recreational, sporting or collecting value, be sold at auction to federally licensed gun dealers at specified times; the weapons may be retained by the sheriff for use on duty if their retention is proper to the ends of justice; or, if a firearm is neither retained for law enforcement use, nor sold as a bona fide sporting, recreational or collectible firearm, it must be destroyed.
(2) The confiscation and destruction, as a "nuisance," of guns "used in the commission of any" misdemeanor, felony, or attempted misdemeanor or felony, is, self-evidently, dependent upon some manner of determining that the guns were "used in the commission of" a crime.
Some crimes would in themselves demonstrate, "upon conviction," that the defendant had "used [the weapon] in the commission" of the crime. For example, a conviction of being an ex-felon in possession of a firearm would necessarily involve use of the firearm in the commission of the crime. "Upon conviction" of the defendant, the fact would be established. Or an assault with a deadly weapon might conclusively involve "use[]" of a firearm "in the commission of" the crime, if the only deadly weapon used was in fact a firearm.
Other crimes, not necessarily involving the use of guns, might nevertheless include enhancement charges of, e.g., being armed with or personally using a firearm.
"Upon conviction" of a crime necessarily involving use of a firearm, or upon a true finding of a firearm enhancement following a conviction for another crime, the firearm involved could properly be declared a nuisance. The person convicted would have had a forum in which to litigate the issue, and to present whatever evidence she or he could muster in her or his own behalf to establish that the firearm was not in fact "used in the commission of" the crime.
The same result obtains "upon conviction" by a plea of guilty. If the charges necessarily involve use of a firearm in their commission, or if the *1102 defendant expressly admits the use of a firearm (either in establishing the factual basis for the plea or through admitting accompanying firearm enhancement allegations), then the factual predicate that the firearm was "used in the commission of" the crime will be properly established. The firearm involved clearly would qualify as a confiscable nuisance.
Here, however, because defendant pleaded guilty, there was never a trial or other hearing on the issue of "use[]" of a firearm "in the commission of" the offense. Moreover, the underlying crime to which he pleaded guilty (cultivation of marijuana) did not necessarily involve the use of any firearms. The factual basis for the plea did not expressly admit use of any guns  defendant was growing marijuana plants in his greenhouse and garden, the officers saw the marijuana growing in the greenhouse, and the officers confiscated the marijuana plants. Guns played no part in what occurred. No firearm enhancements were attached to the charge to which defendant pleaded guilty, nor indeed to any of the charges. Thus, there was nothing to prove, establish, indicate or imply that the firearms seized from defendant's home were in any manner "used in the commission of" the offense of cultivation of marijuana.
The court nevertheless purported to "find" that the firearms were used in the commission of the crime (the court opined that defendant had the weapons to protect his marijuana crop), and declared the firearms to be nuisances. Defendant requested a hearing, which the court denied, stating that Penal Code section 12028 did not provide for a hearing, but rather made the weapons confiscable automatically "upon conviction."
The court erred in holding defendant's firearms confiscable without any hearing whatsoever. Although at first glance Penal Code section 12028 appears to countenance a summary confiscation of property without a hearing, the reason that it does not separately provide for a hearing is obvious: the statute clearly contemplates, as we have described above, that some such determination already will have been made, either necessarily or factually, in the context of the underlying criminal proceedings, either at trial or via a guilty plea.
Indeed, the issue whether a firearm is a nuisance is identical to an issue tried in the underlying charge or enhancement, where the underlying charge necessarily includes use of a firearm, where it is factually established that a firearm was used, or where firearm enhancements accompany the charges. In practice, Penal Code section 12028 only follows a full hearing on, or express admission of, the identical issue (with proof required beyond a reasonable doubt in case of a trial).
*1103 Defendant correctly pointed out to the court below that, without a hearing, proceeding or other forum in which the determination can be made that a weapon was in fact "used in the commission of" an underlying crime (i.e., that it meets the statutory requirements for being declared a confiscable weapon), the confiscation and destruction of the property would be an unconstitutional deprivation of property without due process of law. (Cf., United States v. James Daniel Good Real Property (1993) 510 U.S. ___ [126 L.Ed.2d 490, 114 S.Ct. 492].)
(3) The court failed to recognize the fundamental truth that "The Legislature cannot expropriate private property by mere legislative enactment without violating preeminent principles of constitutional law. (Charnock v. Rose (1886) 70 Cal. 189, 191 [11 P. 625]; Cal. Const., art. I, § 15, formerly art. I, § 13.)" (Espinosa v. Superior Court (1975) 50 Cal. App.3d 347, 352 [123 Cal. Rptr. 448].) In the absence of a necessary factual determination encompassed within defendant's guilty plea  owing to the nature of the charges, or to the admission of a factual basis showing use of a weapon in the commission of the offense, or to the admission of a firearm enhancement  there was no basis for declaring defendant's firearms a nuisance. Accordingly, the court's order to confiscate and destroy the firearms was improper.

II. Writ of Mandate/Appealability

Penal Code section 1237 provides that appeals may be taken "(b) From any order made after judgment, affecting the substantial rights of the party."
It has been held that a motion for return of property that has been used as an exhibit in a trial (Pen. Code, former § 1418; see now, Pen. Code, §§ 1417.3, 1417.5) is not appealable because it does not "affect any substantial right which was a subject of [the criminal] action. The proceeding resulting in such an order [releasing the exhibit to its owner] is entirely separate from the criminal proceeding as such because it does not involve in any manner the charge against defendant or his rights as affected by that charge. Under these circumstances, an order in such a proceeding is not appealable within the purview of Penal Code section 1237, [former] subdivision 3 [order after judgment, affecting the substantial rights of the party, is appealable]." (People v. Tuttle (1966) 242 Cal. App.2d 883, 885 [52 Cal. Rptr. 204], italics added.) The Tuttle court dismissed the appeal, urging that the defendant must apply to have his property returned in "an appropriate proceeding" other than the criminal action. (Ibid.)
The court in People v. Gershenhorn (1964) 225 Cal. App.2d 122 [37 Cal. Rptr. 176], likewise held that a nonstatutory motion for return of allegedly illegally seized property (an interlocutory motion, made in conjunction *1104 with the defendant's motion to suppress the seized items) was not appealable, but could be reviewed by writ of mandate. (Id. at pp. 125-126.)
A more recent case, Espinosa v. Superior Court, supra, 50 Cal. App.3d 347, also deemed a writ of mandate to be the appropriate vehicle to review the denial of a motion to return property, made under Penal Code former sections 1418 and 1419. There, the defendant was acquitted of the charges as to which firearms were admitted as exhibits in the trial against him. He moved for return of the exhibits under Penal Code sections 1418 and 1419.
(4) Defendant here appears to have made a nonstatutory motion for the return of his firearms. The denial of such a motion is, consistently with the cases reviewed above, properly reviewable by writ of mandate.
Penal Code section 12028 does, however, involve an issue "affect[ing a] substantial right which was a subject of [the criminal] action." (People v. Tuttle, supra, 242 Cal. App.2d 883, 885.) By contrast to a motion for return of property  either nonstatutory or pursuant to the provisions for return of exhibits  there is no "separate" proceeding under Penal Code section 12028. Its operation is automatic, upon conviction of an offense involving use of a firearm. Moreover, there is no separate hearing or proceeding precisely because the issue (use of the firearm in the commission of the offense) was an issue in the criminal trial. Thus, the confiscation provision of Penal Code section 12028 does "involve ... the charge against defendant or his rights as affected by that charge." (People v. Tuttle, supra, 242 Cal. App.2d 883, 885.) The deprivation of firearms used in the commission of a convicted offense is one of the rights of the defendant automatically "affected by [the] charge." It would appear, therefore, that an erroneous ruling under Penal Code section 12028 is appealable as an order after judgment. (See Pen. Code, § 1237, subd. (b).)
The People contend that defendant waived his right to appeal as part of the plea bargain. The waiver of defendant's right to appeal does not appear on the written plea bargain form. At the hearing on the change of plea, defense counsel stipulated to a factual basis for the guilty plea, but refused to stipulate that the search was lawful. The court thereupon inquired whether defendant had given up his right to appeal; defense counsel responded in the affirmative: "My explanation to him was he has no right at this stage to appeal in any case because no motions were made in Superior Court and his previous lawyer made it in Municipal Court." Defendant personally affirmed that he "underst[oo]d that." In context, it appears that what defendant waived was his right to appeal denial of a motion to suppress evidence. (Pen. Code, § 1538.5.)
*1105 Penal Code section 1237.5 provides that, after a guilty plea, no appeal can be taken except where the defendant meets certain preliminary requirements. The defendant must (a) execute a written statement under penalty of perjury demonstrating the existence of a constitutional, jurisdictional, or other ground going to the legality of the proceedings and (b) secure a certificate of probable cause from the trial court. Penal Code section 1237.5 does not apply, however, to an appeal reviewing the validity of a search and seizure. Penal Code section 1538.5, subdivision (m), specifically preserves the right to appeal the validity of a search and seizure, even if the defendant has pleaded guilty. The context of discussion between the court, counsel, and defendant at the hearing on the change of plea indicates that defendant had given up his right to appeal on the search and seizure issue. Defendant does not here purport to appeal on the search and seizure issue. There is no indication in the record that defendant waived all rights to appeal generally. He did not waive his right under Penal Code section 1237.5 to an appeal  on issues other than the search and seizure of evidence  following a guilty plea.
The People urge that, even if defendant did not waive all appeal rights, defendant failed to comply with the requirements of Penal Code section 1237.5. Specifically, the People point out that defendant never secured a certificate of probable cause from the trial court on the issue of confiscation of his firearms. Penal Code section 1237.5 does not apply to grounds for appeal that occur after the entry of the guilty plea, and which do not challenge the validity of the plea. (Cal. Rules of Court, rule 31(d).) The confiscation of defendant's firearms under Penal Code section 12028 clearly was a ground of appeal that arose after the plea. Defendant does not otherwise challenge the validity of his plea, except to the extent he argues he was not informed of the "additional punishment" (confiscation of his firearms) that would be imposed as a consequence of his plea. Penal Code section 1237.5 did not apply to this appeal; defendant was not required to secure a certificate of probable cause. (See People v. Kaanehe (1977) 19 Cal.3d 1 [136 Cal. Rptr. 409, 559 P.2d 1028] [certificate of probable cause to appeal following a guilty plea is not required where the claim is breach of a plea bargain, the breach occurred after entry of the plea and pertained only to sentencing].) Moreover, defendant's appeal was operative because he identified the specific ground for appeal in his notice of appeal, a ground that clearly arose after the entry of the plea. (See People v. Ballard (1985) 174 Cal. App.3d 982 [220 Cal. Rptr. 323], criticized in People v. Knauer (1988) 206 Cal. App.3d 1124 [253 Cal. Rptr. 910], but see People v. Earls (1992) 10 Cal. App.4th 184 [12 Cal. Rptr.2d 606].)
We conclude, therefore, that both the appeal (from the order after judgment confiscating defendant's firearms pursuant to Penal Code section *1106 12028) and the writ of mandate (reviewing the denial of the motion to return defendant's property) were proper proceedings.

DISPOSITION
The order confiscating defendant's firearms under Penal Code section 12028 is reversed. None of the elements of the offenses with which defendant was charged related to firearm use, and no firearm enhancements were included in the charges to which defendant pleaded guilty. The court had no power to declare the firearms a nuisance in the absence of a specific adjudication of the issue whether the firearms were "used in the commission of" defendant's crime. To hold otherwise would violate fundamental precepts of due process. Because we hold the firearms were improperly confiscated and that Penal Code section 12028 was inapplicable here, there is no ground upon which defendant may withdraw his plea. The judgment is therefore affirmed in all other respects.
The petition for writ of mandate is granted, and the court is directed to grant defendant's motion for return of his firearms.[3] Of course, now that defendant is a convicted felon, he cannot own or possess, or have custody or control over the firearms. Nevertheless, it is defendant, not the state, who has the right to designate disposition of the title. The successor owner, if qualified, may obtain possession of the firearms.
Hollenhorst, J., and McKinster, J., concurred.
NOTES
[1]  This court's order that the writ petition will be considered together with the filed appeal erroneously refers to the petition as one for habeas corpus. As noted below, defendant correctly styled his petition as one for writ of mandate.
[2]  We are aware of the 1988 amendment to Health and Safety Code section 11470, providing that the section remain in effect until January 1, 1994, and that after that date the section as it read on December 31, 1988, would have the same force and effect as if it had not been amended. (Stats. 1988, ch. 1492, §§ 1, 16, pp. 5285-5287, 5298.) Health and Safety Code section 11470 as it read on December 31, 1988, included a provision that it would remain in effect only until January 1, 1989, unless an amendment enacted before January 1989, deleted or extended that date. We recognize that the inelegant language of the 1988 amendment may ultimately have caused section 11470 to be repealed as of January 1, 1994. Nonetheless, Health and Safety Code section 11470 was in full force and effect in 1990, when these proceedings commenced. The possible later repeal of section 11470 does not affect our analysis of the arguments here raised on appeal.
[3]  The People could have chosen to proceed under either the drug-related asset forfeiture provisions of the Health and Safety Code, or under Penal Code section 12028, or under both. Neither was exclusive or controlling over the other. At this date, however, assuming that forfeiture proceedings could be instituted (see fn. 2, ante), it would be far too late for the People to file a forfeiture action as to the firearms. The in rem forfeiture action must be filed within one year after the property has been seized. (See Health & Saf. Code, § 11488.4, subd. (a).)
