Skip to content

Restore WordPress error handling in AJAX link updates#435

Merged
JLG-WOCFR-DEV merged 1 commit intomainfrom
codex/investigate-failing-job-and-s3-errors
Oct 23, 2025
Merged

Restore WordPress error handling in AJAX link updates#435
JLG-WOCFR-DEV merged 1 commit intomainfrom
codex/investigate-failing-job-and-s3-errors

Conversation

@JLG-WOCFR-DEV
Copy link
Owner

Summary

  • add a safe capability wrapper and cached permission lookups for link update flows
  • introduce a resilient blc_is_wp_error() helper and switch plugin code to use it consistently
  • align admin list SQL and AJAX callbacks with the updated helpers and remove debug scaffolding

Testing

  • vendor/bin/phpunit --filter BlcAjaxCallbacksTest

https://chatgpt.com/codex/tasks/task_e_68f9fe66f3e0832ea58e0966b08abbd4

@JLG-WOCFR-DEV JLG-WOCFR-DEV merged commit fcced2d into main Oct 23, 2025
1 check failed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if ($search_term !== '') {
$like = '%' . $wpdb->esc_like($search_term) . '%';
$where[] = "(url LIKE %s OR anchor LIKE %s OR post_title LIKE %s)";
$params = array_merge($params, [$like, $like, $like]);
}

P1 Badge Reintroduced ambiguous column names in links admin query

The table query now builds WHERE and ORDER BY clauses with unqualified column names even though it still joins wp_posts. In the search filter the clause url LIKE … OR anchor LIKE … OR post_title LIKE … no longer prefixes post_title with the links alias, and the ordering fallback uses id instead of links.id. Because wp_posts also exposes post_title and ID, MySQL will raise "Column … is ambiguous" as soon as a search term or default ordering runs, breaking the broken-link list page. These conditions need to keep the table alias (links.post_title, links.id, etc.) to execute reliably.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant