Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect Button: Malformed href. #7988

Closed
georgestephanis opened this issue Oct 13, 2017 · 7 comments
Closed

Connect Button: Malformed href. #7988

georgestephanis opened this issue Oct 13, 2017 · 7 comments
Labels

Comments

@georgestephanis
Copy link
Member

georgestephanis commented Oct 13, 2017

When viewing the connect button, the markup looks something like this:

<div data-reactid=".0.0.1.2.0.1.2:1">
<noscript data-reactid=".0.0.1.2.0.1.2:1.0"></noscript>
<a href="&amp;from=landing-page-top" type="button" class="is-primary jp-jetpack-connect__button dops-button" data-reactid=".0.0.1.2.0.1.2:1.1">Connect Jetpack</a>
<noscript data-reactid=".0.0.1.2.0.1.2:1.2"></noscript>
</div>

Specifically the href="&amp;from=landing-page-top" bit is caused by this code here:

let connectUrl = this.props.connectUrl;
if ( this.props.from ) {
connectUrl += `&from=${ this.props.from }`;
}

being triggered by

<ConnectButton from="landing-page-top">

There is no this.props.connectUrl specified, so the link appends &from=${ this.props.from } onto an empty variable, resulting in the malformed href.

Steps to reproduce the issue

Visit the connect page and inspect the button.

What I expected

A valid url in the href attribute.

What happened instead

A malformed url.

@georgestephanis
Copy link
Member Author

I'm investigating further -- this may actually be not an issue.

@oskosk
Copy link
Contributor

oskosk commented Oct 13, 2017

@georgestephanis this seems related: #7979

@georgestephanis
Copy link
Member Author

I'm running a distclean and reinstall right now.

Also this is in a multisite install, so that could potentially affect it as well.

Checking ...

@oskosk
Copy link
Contributor

oskosk commented Oct 13, 2017

is it subdomain based multisite or subdir-based ?

@georgestephanis
Copy link
Member Author

subdomain

@oskosk
Copy link
Contributor

oskosk commented Oct 13, 2017

fwiw, when visiting the Jetpack admin page, there should be a background request to the plugin's rest endpoint /connection/url. If the response of that endpoint is not a single string between quotes, then there's a problem similar to the one reported in 7979.

@georgestephanis
Copy link
Member Author

georgestephanis commented Oct 13, 2017

Nevermind, this was a duplicate of an unrelated thing I was working on -- https://wordpress.org/support/topic/domain-mapping-connect-issue/

The rest api endpoints weren't queryable because of the wpmu domain mapping plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants