It’s pretty sad when you feel the need to title your comedy to remind people of an Adam Sandler movie, even one of his better ones. But that’s what the makers of “The Wedding Singer” (sorry, “Ringer”) have done.

The picture is a starring vehicle for Kevin Hart, who hit the box office bulls-eye with “Ride Along” and is now a hot commodity. This time around he’s paired not with Ice Cube but Josh Gad, who plays Doug Harris, a friendless nebbish desperately in need of a best man and seven groomsmen for his upcoming wedding to one Gretchen Palmer (Kaley Cuoco-Sweeting). At the suggestion of their ultra-swishy planner Edmundo (Ignacio Serricchio), he visits the office of Jimmy Callahan (Kevin Hart), who makes a living pretending to be the best friend/man for fellows who can’t secure one for themselves. Though Doug’s plea reeks of desperation—it will require Jimmy to pretend to be a military chaplain named Bic Mitchum while recruiting and preparing seven other guys in addition to himself to make up the wedding party—the consummate fixer agrees to take on the huge assignment, which those in his line of work call a “golden tux” because it’s never been successfully pulled off.

Of course, much madness ensues—a meet-and-greet luncheon with the bride’s family, training sessions for the phony groomsmen, a wild bachelor party, a mud-slogged football game arranged by the bride’s father (with Joe Namath as his quarterback), a rehearsal dinner and, of course, the ceremony itself, burdened with lots of last-minute snafus.

During all this, several patterns become apparent:

(1) The script is basically misogynist. Yes, this is a guy movie, and so one expects the misfits that Jimmy collects to play the groomsmen to be a bunch of oddballs—the most notable of whom is Jorge Garcia from “Lost” (which serves as the basis for the final joke). But all of them, however weird they are and however gross their actions, are ultimately portrayed affectionately. On the other hand, except for a couple of them, all the female characters are either selfish (like the bride) or air-headed. To be sure, there’s a stripper called Nadia (Nicky Whelan) who has the proverbial heart of gold. And the bride’s sister, who’s also her maid of honor (Olivia Thirlby), is a clever gal who sees through Jimmy’s charade. But that just makes her like him all the more.

(2) It’s also homophobic. The first joke, delivered by the bride’s macho father (Ken Howard), uses “gay” as an insult (others instances will follow), and Edmundo is treated as a walking visual gag. (There’s a switch halfway through that revisits the character, but in trying to subvert the stereotype it just creates another.) It’s a curious fact about the proliferation of bromances like this one that the genre requires squeamish males in the audience to be reassured that there’s nothing sexual at work—even when the pals engage in a prolonged dance sequence as they do here (one of the two obligatory music montages, the other being the bachelor party).

(3) It has a curious tendency to engage in what amounts to elder abuse for laughs. That football game, which ends with the oldsters getting pummeled and kicked, is one example. But what to make of that get-together lunch, which ends with the bride’s grandmother (Cloris Leachman) literally going up in flames? And as if that weren’t bad enough, a tasteless joke about her follows, as well as a later shot of her near-mummified face. Let’s just say it’s not a pretty sight.

(4) It goes without saying that the movie is endlessly rowdy and raunchy, in both the language and the slapstick. It likes violence, not only in the football scene (people—even children—being pelted with baseballs, for instance); Gad is the special target, going through a brutal comic abduction (at least since Doug’s face is covered with a mask, you know it’s a stuntman taking the fall) but, even worse, suffering a prolonged scene in which his privates are attacked by a dog. We should be thankful, one supposes, that the details of that assault are kept off-screen—as we can for the fact that we don’t get visual proof of one groomsman’s repeated assurances that he has three testicles.

But despite—or because of—such matters, this reviewer must report that the preview audience seemed to enjoy “The Wedding Ringer” enormously, and even those likely to find some parts of it offensive will probably chuckle elsewhere. The plot may be idiotic, but at least it’s preferable to the last script by Jeremy Garelick (who also directs here, adequately) and Jay Lavender, the Vince Vaughn-Jennifer Aniston bomb “The Break-Up.” And the picture does have some other virtues. While Hart, for example, gets the opportunity to do some of the frenetic shtick his fans love, he’s also given some quieter moments, and it’s nice to see he can work at a lower volume. (Naturally, Jimmy mellows as the story proceeds, and by the close he’s a softie, ready for real friendship and romance himself.) And Gad, though forced to play a character who’s basically a dolt, shows real comic chops; he’s not just a chubby fellow filmmakers should go to when Jonah Hill is unavailable. They work well together, too, even in that dance sequence. Each of the groomsmen—Garcia, Affion Crockett, Dan Gill, Corey Holcomb, Colin Kane, Alan Ritchson and Aaron Takahashi—has his moments, however broad, and Serricchio does the swishy bit with the necessary flamboyance. Howard, meanwhile, makes a thoroughly detestable jerk.

The movie is also a more polished piece of work than many of today’s second-tier comedies. Bradford Lipson’s widescreen cinematography is crisp, and Chris Cornwell’s production design keeps things colorful. As edited by the trio of Jeff Groth, Shelly Westerman and Byron Wong, things do get bumpily episodic, but that’s more the fault of the script’s tendency to deteriorate in the latter stages than their technical failings.

The verdict? This “Wedding” is by no means a classy affair, but in the post-“Hanover” era it’s not the worst comedy to come along. That may be faint praise, but it’s all Hart and company deserve.