Skip to content

ORCID: Added a guard before rendering the OAuth buttons#1875

Merged
pascal-meunier merged 2 commits into
2.4-mainfrom
fix/orcid_client_ID
May 4, 2026
Merged

ORCID: Added a guard before rendering the OAuth buttons#1875
pascal-meunier merged 2 commits into
2.4-mainfrom
fix/orcid_client_ID

Conversation

@pascal-meunier
Copy link
Copy Markdown
Contributor

ticket https://nanohub.org/support/ticket/505173

Two changes made:

config/config.xml — Changed orcid_service default from "public" to "members". The XML default was "public" but every PHP code path uses 'members' as its
fallback, so if an admin ever saved the config page without explicitly choosing a service it would store "public" — and there's no orcid_public_client_id
field, making $clientID permanently empty.

models/fields/orcid.php — Added an $oauthConfigured guard before rendering the OAuth buttons:
$oauthConfigured = ($srv !== 'public' && !empty($clientID) && !empty($redirectURI));
The "Create or Connect" and "Grant Permission" buttons now only appear when:

  • The service is not 'public' (which is documented as search-only)
  • orcid_members_client_id (or sandbox) is actually filled in
  • The redirect URI is configured

This prevents users from clicking a broken link that ORCID rejects. Until the admin configures orcid_members_client_id and orcid_members_redirect_uri in
Administrator → Components → Members → Options, the buttons will simply not appear.

@pascal-meunier
Copy link
Copy Markdown
Contributor Author

config/config.xml is not included in this pull request because:
The following paths are ignored by one of your .gitignore files:
core/components/com_members/config
hint: Use -f if you really want to add them.
hint: Disable this message with "git config advice.addIgnoredFile false"

@pascal-meunier pascal-meunier force-pushed the fix/orcid_client_ID branch from 0e6a57e to 4217a24 Compare May 4, 2026 11:45
@pascal-meunier pascal-meunier merged commit 37e864b into 2.4-main May 4, 2026
@pascal-meunier pascal-meunier deleted the fix/orcid_client_ID branch May 4, 2026 11:46
@pascal-meunier pascal-meunier restored the fix/orcid_client_ID branch May 7, 2026 13:18
@pascal-meunier pascal-meunier deleted the fix/orcid_client_ID branch May 7, 2026 13:25
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

Successfully merging this pull request may close these issues.

2 participants