How the 1940s standard “Happiness Is a Thing Called Joe” failed to be adapted into a Joe Biden campaign song until now is a mystery, but Cher recognized the obvious pairing of classic song and candidate and has recorded her rewrite of the tune, which was originally sung by Ethel Waters in the 1943 film “Cabin in the Sky.”

The song, with music by Harold Arlen and lyrics by E.Y. Harburg, was nominated for an Oscar after Waters sang it in the Black-themed Vincente Minnelli film. Many of the original lyrics would not do — Waters refers to “little Joe” in the film version, which sounds more like a nickname Donald Trump would apply to the candidate than something they’d want in a campaign anthem. So that reference gets changed to “president Joe” in Cher’s version, among other alterations.

Cher introduced the song Sunday night in closing “I Will Vote,” an online benefit for the Biden/Kamala Harris campaign that also featured guests including John Legend and Pink. She officially released the song for streaming and download Monday morning.

Cher’s version adds a single word to the title to make it “Happiness Is Just a Thing Called Joe”; whether that was inadvertent or done at the behest of the writers’ estates to distinguish it from the original is not clear. The first three lines are the same as what Waters sings to the Joe character in the ’43 film — including “He’s got a smile that makes the lilacs want to grow / He’s got a way that makes the angels heave a sigh” — but diverge into more national interests from there.

“Sometimes the cabin’s gloomy and the table’s bare” becomes “Right now our country’s gloomy, fear is in the air.” “Does he love me good? That’s all I need to know” is turned into “Joe will keep us safe, that’s all we need to know.”

Biden’s famous smile is good for a second reference in Cher’s version, as opposed to just one in the original, as she begins a second refrain with: “Sometimes there seems no end to misery and despair / But when Joe smiles at us, compassion fills the air.” As a coda, she repeats the phrase “President Joe” three times, with an extra bit of inspirational melisma on the final spin.

Matt Serletic produced the track, which has famous session player Matt Rollings on piano.

Cher’s rewrite is part of a great political campaign tradition, although there have been fewer instances in recent decades. In 1960, Sammy Cahn himself handled the rewrite on “High Hopes,” as Frank Sinatra turned his then still fairly fresh hit into an anthem for JFK. “Everyone is voting for Jack / Cause he’s got what all the rest lack / Everyone wants to back —Jack / Jack is on the right track,” went the new lyrics.

Similarly, Jerry Herman rewrote “Hello Dolly” for Carol Channing to sing for Lyndon Johnson in 1964 as “Hello Lyndon.” And Sam Moore of Sam & Dave turned “Soul Man” into “Dole Man” for Bob Dole. There are few other known instances, though, if any, in which the candidate’s name was already existing and waiting in a known song.