Skip to content

Refactor translationwizard forms#7

Merged
NB-Core merged 1 commit into
tlwizardfrom
codex/refactor-form-handling-and-styling
Jul 13, 2025
Merged

Refactor translationwizard forms#7
NB-Core merged 1 commit into
tlwizardfrom
codex/refactor-form-handling-and-styling

Conversation

@NB-Core
Copy link
Copy Markdown
Owner

@NB-Core NB-Core commented Jul 13, 2025

Summary

  • centralize wizard form markup helpers
  • use the new helper in the translation wizard default page
  • use the new helper in the duplicate-check workflow

Testing

  • php -l systems/translationwizard/translationwizard/form_helpers.php
  • php -l systems/translationwizard/translationwizard/check.php
  • php -l systems/translationwizard/translationwizard/default.php
  • php -l systems/translationwizard/translationwizard.php

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

@NB-Core NB-Core requested a review from Copilot July 13, 2025 14:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR centralizes form markup into helper functions (tw_form_open and tw_form_close) and refactors existing pages to use these helpers.

  • Introduce form_helpers.php with tw_form_open and tw_form_close
  • Update default.php to replace raw <form> markup with helper calls
  • Update check.php to replace raw <form> markup with helper calls
  • Require the new helper in the main module file

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
systems/translationwizard/translationwizard/form_helpers.php Add helper functions for opening and closing forms
systems/translationwizard/translationwizard/default.php Replace inline form and hidden inputs with helper calls
systems/translationwizard/translationwizard/check.php Replace inline form and hidden inputs with helper calls
systems/translationwizard/translationwizard.php Add require_once for the new helper file
Comments suppressed due to low confidence (2)

systems/translationwizard/translationwizard.php:8

  • The require_once path is incorrect: form_helpers.php is located alongside translationwizard.php in the same directory. Update to use a relative path, for example: require_once DIR . '/form_helpers.php';
require_once("modules/translationwizard/form_helpers.php");

systems/translationwizard/translationwizard/check.php:83

  • Including 'op' => 'check' as a hidden field duplicates the action's GET parameter and may override the mode. Consider removing the redundant hidden 'op' or move 'mode' into the hidden array instead of embedding it in the action string.
                tw_form_open('check&mode=delete', ['op' => 'check']);

@NB-Core NB-Core merged commit 7415d49 into tlwizard Jul 13, 2025
@NB-Core NB-Core deleted the codex/refactor-form-handling-and-styling branch July 13, 2025 14:36
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.

2 participants