Skip to content

com_tools: a denied export check no longer fatals on PHP 8 - #1955

Open
denphi wants to merge 1 commit into
hubzero:2.4-mainfrom
denphi:fix/tools-export-access-error-object
Open

denphi wants to merge 1 commit into
hubzero:2.4-mainfrom
denphi:fix/tools-export-access-error-object

Conversation

@denphi

@denphi denphi commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

getToolExportAccess() creates $export_access as a bare stdClass, then every denial branch writes to $export_access->error->message. Under PHP 8 assigning a property on null is an Error, so each of the five refusals -- unknown location, E1 nation, US-only, D1 licence and Purdue-only -- killed the request instead of returning the denial.

It only ever bit users who were refused, which is why the tool pages looked healthy for everyone else.

Initialise ->error the same way the sibling getToolAccess() already does. The sole caller reads only ->valid, so nothing else changes.

Before you submit this pull request, please make sure:

  • [] Make sure there are links in the PR to the source JIRA card(s) and hubzero ticket(s)
  • [] Include a brief summary of the issue in your own words
  • [] Include a brief summary of the fix/changed code
  • [] Include a brief summary of your testing. What did you specifically do to investigate that this change has the correct results?
  • [] Indicate if the change needs to be hotfixed to any production hubs before a normal core rollout
  • [] Double check someone is assigned to review the ticket

Thanks!

getToolExportAccess() creates $export_access as a bare stdClass, then
every denial branch writes to $export_access->error->message. Under
PHP 8 assigning a property on null is an Error, so each of the five
refusals -- unknown location, E1 nation, US-only, D1 licence and
Purdue-only -- killed the request instead of returning the denial.

It only ever bit users who were refused, which is why the tool pages
looked healthy for everyone else.

Initialise ->error the same way the sibling getToolAccess() already
does. The sole caller reads only ->valid, so nothing else changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@denphi
denphi requested a review from nkissebe as a code owner October 25, 2026 15:38

This branch has not been deployed

No deployments
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.

1 participant