Fix SQL logic bug and Admin UI hydration#1
Fix SQL logic bug and Admin UI hydration#1google-labs-jules[bot] wants to merge 3 commits intomainfrom
Conversation
- In `includes/frontend.php`, changed the SQL query for mapping values from `LIKE` to `=` to prevent partial matches (e.g. Post ID 1 matching Post ID 11). - In `includes/admin.php`, added hydration logic to fetch post titles and term names for the `fqj_assoc_data` JSON payload, ensuring Select2 inputs are correctly pre-filled on page load.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
- Fix PSR-12 coding standard violations across all files (line length, spacing, indentation). - Rename `FQJ_CLI` class to `FQJ\FqjCli` and methods to camelCase to comply with PSR-1. - Fix SQL logic bug in `includes/frontend.php` (changed `LIKE` to `=`) to prevent incorrect mapping matches. - Fix Admin UI bug in `includes/admin.php` by hydrating Select2 data to display titles instead of IDs. - Add `squizlabs/php_codesniffer` to composer dev dependencies.
…l bugs
- Rename `includes/wpcli.php` to `includes/class-fqjcli.php` and use `snake_case` methods.
- Update `composer.json` to include `wp-coding-standards/wpcs` and allow installer plugin.
- Fix thousands of formatting issues (spacing, tabs, Yoda conditions, arrays) using `phpcbf`.
- Manually fix logic bugs:
- Hydrate Admin UI Select2 fields with titles in `includes/admin.php`.
- Fix SQL logic in `includes/frontend.php` (changed `LIKE` to `=`) and implement secure prepared statements.
- Add proper escaping (`esc_html`, `esc_attr`, `intval`) and sanitization (`sanitize_text_field`, `wp_unslash`) throughout.
- Add missing docblocks and `@package` tags.
This PR addresses two main issues:
LIKEcomparisons for IDs. This meant that mapping an FAQ to Post ID 1 would also cause it to appear on Post IDs 11, 10, 100, etc. This has been fixed to use exact=comparison.PR created automatically by Jules for task 9901016997777217283 started by @renderbit-technologies