Skip to content

forum_interface_*: Make sure JSON & PHPBB3 have same interfaces - #1625

Merged
cpeel merged 1 commit into
DistributedProofreaders:masterfrom
bpfoley:align-json-w-phpbb3
Sep 4, 2026
Merged

cpeel merged 1 commit into
DistributedProofreaders:masterfrom
bpfoley:align-json-w-phpbb3

Conversation

@bpfoley

@bpfoley bpfoley commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

After a 'Return value must be of type array, null returned' error reported by mrducky.

This should in theory have been caught by pageload_smoketest.py, but unfortunately can't currently be, because the CI environment runs only with the forum_interface_json.inc code, and we'd need to set up an entire phpbb3 install to catch this in CI.

In particular, make sure that all the phpb33 functions that return rows from the database have nullable return types.

Fix some inconsistencies where, e.g., JSON returns 0 and PHPBB3 returns null for a non-existent user.

While here, make some error handling code less verbose.

After a 'Return value must be of type array, null returned' error
reported by mrducky.

This should in theory have been caught by pageload_smoketest.py, but
unfortunately can't currently be, because the CI environment runs
only with the forum_interface_json.inc code, and we'd need to set
up an entire phpbb3 install to catch this in CI.

In particular, make sure that all the phpb33 functions that return
rows from the database have nullable return types.

Fix some inconsistencies where, e.g., JSON returns 0 and PHPBB3
returns null for a non-existent user.

While here, make some error handling code less verbose.
@cpeel

cpeel commented Sep 4, 2026

Copy link
Copy Markdown
Member

While here, make some error handling code less verbose.

Not sure what this is referring to. Is there a missed commit or am I just overlooking something in the diff?

@bpfoley

bpfoley commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

While here, make some error handling code less verbose.

Not sure what this is referring to. Is there a missed commit or am I just overlooking something in the diff?

Just the use of

return $row["rank_title"] ?? null;

instead of

if (!$row) {
   return null;
}

return $row["rank_title"];

@cpeel
cpeel merged commit 7f100f0 into DistributedProofreaders:master Sep 4, 2026
12 checks passed
@bpfoley
bpfoley deleted the align-json-w-phpbb3 branch September 4, 2026 19:22
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