Second Page of Staging Connection Reset throwing PHP Warning
In line 5984 of class.jetpack.php there is a reference to a third url variable that is not being defined. It looks like it's just trying to link to https://jetpack.me/support/what-does-resetting-the-connection-mean/ but for whatever reason it's not finding it and throwing a php warning for the printf function.
This warning is making nothing display in it's place. I've been able to replicate this with every staging I have access to.
This was fixed by hard coding the url since it doesn't seem to need to be a variable piece of information. Should I create a pull request or is this something easy enough to handle through this issue?
<p><?php printf(
/* translators: %1$s, %2$s and %3$s are URLs */
__(
'Are <strong> %2$s </strong> and <strong> %1$s </strong> two completely separate websites? If so we should create a new connection, which will reset your followers and linked services. <a href="https://jetpack.me/support/what-does-resetting-the-connection-mean/"><em>What does this mean?</em></a>',
'jetpack'
),
$errors[ $key ],
(string) get_option( $key ),
'https://jetpack.me/support/what-does-resetting-the-connection-mean/'
); ?></p>
The href change above fixes it.
What was the notice being thrown? I couldn't duplicate a problem.
I'm getting "Warning: printf(): Argument number must be greater than zero in /nas/wp/www/staging/antpb/wp-content/plugins/jetpack/class.jetpack.php on line 5991"
Inside of the red box. This is in the staging environment of a vanilla WordPress install on WP Engine with only jetpack installed.
@anthonyburchell this looks like a problem with translated strings. What locale are you using? If I understand correctly, printf was barfing because __() returned nothing, and by changing the string you forced it outside the known translations and made it output it unchanged.
I was able to duplicate now. The WP Engine site that we used for testing all of this didn't throw the error, but another random WP Engine site in my account is doing so.
It is choking on the type hinting. PR incoming.
@anthonyburchell Can you try the fix in #2696 (remove (string) from the preceding line)?
@kraftbj Sure thing. I'll report back.
@kraftbj No dice :( Seems like it's still not finding %3$s
@anthonyburchell Just to make sure, can you please revert all changes and just try to remove the translator comment?
@zinigor that was actually my very first test and that did not make any change
Forced a new push on #2696. It's the placeholder. We mistyped the placeholder. :shame: I'm not sure atm why it worked on a half-dozen other systems, including some WP Engine sites, but obviously not all of them.