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

Member script injected when url:false is set #21907

Closed
1 task done
ltoinel opened this issue Dec 17, 2024 · 3 comments
Closed
1 task done

Member script injected when url:false is set #21907

ltoinel opened this issue Dec 17, 2024 · 3 comments

Comments

@ltoinel
Copy link
Contributor

ltoinel commented Dec 17, 2024

Issue Summary

The issue #12865 seems to be back ... since the 5.104.0 or maybe before.

When "false" is used as URL like described in the documentation : https://ghost.org/docs/config/

"The script can be relocated by changing the URL, or disabled entirely by setting "url": false."

The member script is injected in the page with "false" as a URL creating 404 error on web spiders :
<script defer src="false" data-i18n="true" data-ghost="https://www.geeek.org/" data-key="xxxxx" data-api="https://www.geeek.org/ghost/api/content/" data-locale="fr" crossorigin="anonymous"></script>

Steps to Reproduce

Disable the portal in the config file
"portal": { "url": false },

Ghost Version

5.105.0

Node.js Version

18.20.5

How did you install Ghost?

Linux Ubuntu self hosting

Database type

MySQL 5.7

Browser & OS version

No response

Relevant log / error output

No response

Code of Conduct

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Dec 17, 2024
@kevinansfield
Copy link
Member

Setting the portal url to false has never been supported so this isn't a recent regression.

If you don't want the core portal script (or a custom version) to be loaded then you'll need to disable members, donations, and recommendations in your site settings. If you use any of those features you'll need the portal script to be present for them to work.

@github-actions github-actions bot removed the needs:triage [triage] this needs to be triaged by the Ghost team label Dec 18, 2024
@ltoinel
Copy link
Contributor Author

ltoinel commented Dec 19, 2024

@kevinansfield : Documentation issue ?
"The script can be relocated by changing the URL, or disabled entirely by setting "url": false."
https://ghost.org/docs/config/

@ltoinel
Copy link
Contributor Author

ltoinel commented Dec 19, 2024

If found my issue, recommandations needs also to be disabled to avoid to load the portal JS helper in the header.

if (!settingsCache.get('members_enabled') && !settingsCache.get('donations_enabled') && !settingsCache.get('recommendations_enabled')) {
        return '';
}

The "url": false" has no effect and should be removed from the documentation or we have to add :

if (!scriptUrl) {
        return '';
}

In the getMembersHelper function, like the getSearchHelper function.

#21936

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

No branches or pull requests

2 participants