Skip to content

Conversation

@ChristianVierthaler
Copy link
Contributor

@ChristianVierthaler ChristianVierthaler commented Dec 17, 2025

Pull Request Checklist (Feature Branch to next):

  • Ich habe die neuesten Änderungen aus dem next Branch in meinen Feature-Branch gemergt.
  • Das Code-Review wurde abgeschlossen.
  • Fachliche Tests wurden durchgeführt und sind abgeschlossen.

Summary by CodeRabbit

  • Style

    • Custom text fields in queue management tables now feature automatic text wrapping, word breaking, and maximum width constraints to improve readability and better handle long or complex content.
  • Bug Fixes

    • Amendment and custom text fields are now consistently set and fully displayed in all process data workflows, ensuring complete data visibility in all scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

📝 Walkthrough

Walkthrough

Two targeted changes to process data handling and display: unconditional assignment of amendment and custom text field values during data population in a query method, paired with CSS styling to constrain and wrap these fields in queue table cells.

Changes

Cohort / File(s) Summary
Data Handling
zmsdb/src/Zmsdb/Query/Process.php
Removed conditional checks for three fields in addValuesClientData; Anmerkung (Amendment), custom_text_field (CustomTextfield), and custom_text_field2 (CustomTextfield2) are now unconditionally assigned from the process object.
Presentation
zmsadmin/templates/block/queue/table.twig
Added .limited-width CSS class to table cells displaying custom text fields with overflow-wrap: break-word, hyphens: auto, and max-width: 300px for content wrapping.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • ThomasAFink

Poem

🐰 Hopping through queries with unbounded cheer,
No more conditions, the values are clear!
We constrain the width where text fields play,
Amendment and custom fields, set all the way!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(ZMSKVR-1056): optional textfield in admin' directly aligns with the changes made: introducing optional/conditional handling of custom text fields in the admin interface by limiting their width and styling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3de4b50 and 175ecf4.

📒 Files selected for processing (3)
  • zmsadmin/templates/block/appointment/form.twig (2 hunks)
  • zmsdb/src/Zmsdb/Query/Process.php (1 hunks)
  • zmsentities/src/Zmsentities/Process.php (3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the following Clean Code guidelines to all files, as summarized by wojteklu's Clean Code gist:

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

  1. Keep configurable data at high levels.
  2. Prefer polymorphism to if/else or switch/case.
  3. Separate multi-threading code.
  4. Prevent over-configurability.
  5. Use dependency injection.
  6. Follow Law of Demeter. A class should know only its direct dependencies.

Understandability tips

  1. Be consistent. If you do something a certain way, do all similar things in the same way.
  2. Use explanatory variables.
  3. Encapsulate boundary conditions. Boundary conditions are hard to keep track of. Put the processing for them in one place.
  4. Prefer dedicated value objects to primitive type.
  5. Avoid logical dependency. Don't write methods which works correctly depending on something else in the same class.
  6. Avoid negative conditionals.

Names rules

  1. Choose descriptive and unambiguous names.
  2. Make meaningful distinction.
  3. Use pronounceable names.
  4. Use searchable names.
  5. Replace magic numbers with named constants.
  6. Avoid encodings. Don't append prefixes or type information.

Functions rules

  1. Small.
  2. Do one thing.
  3. Use descriptive names.
  4. Prefer fewer arguments.
  5. Have no side effects.
  6. Don't use flag arguments. Split method into several independent methods that can b...

Files:

  • zmsdb/src/Zmsdb/Query/Process.php
  • zmsadmin/templates/block/appointment/form.twig
  • zmsentities/src/Zmsentities/Process.php
**/*.php

⚙️ CodeRabbit configuration file

**/*.php: Flag any usage of error_log() as it should be replaced with proper Monolog logging mechanisms provided by zmsslim which should be setup in the App/Application of each module:

  1. For error handling: Use the proper Monolog logging framework with error levels
  2. For application info logs: Use the proper Monolog logging framework with info levels
  3. For debugging: Use a dedicated debug logger or remove debug statements
  4. For CLI output: Use a CLI output handler or symfony/console
  5. The application log levels are as follows DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL, ALERT, and EMERGENCY

Example replacement:

// Instead of:
error_log("Import failed - " . $e->getMessage());

// Use:
$log->error("Import failed", ['error' => $e->getMessage()]);

Flag specific logging violations:

  1. error_log(), var_dump(), print_r(), die(), exit() usage (except proper error logging in catch blocks)
  2. Any debug output that should use proper Monolog logging
  3. Debug constants like DEBUG = true
  4. Debug logging that should be removed in production
  5. Commented debug code that should be cleaned up

Example replacements:

// Instead of:
error_log("Error occurred");
var_dump($data);
die('debug point');

// Use:
$log->error("Error occurred", ['context' => 'processing']);
$log->debug('Data dump', ['data' => $data]);
// Remove die() statements entirely

Exception handling should use proper logging:

// Instead of:
try {
    $result = $this->process();
} catch (Exception $e) {
    error_log("Processing failed: " . $e->getMessage());
}

// Use:
try {
    $result = $this->process();
} catch (Exception $e) {
    $log->error("Processing failed", ['error' => $e->getMessage(), 'trace' => $e->getTraceAsString()]);
}
```...

Files:

  • zmsdb/src/Zmsdb/Query/Process.php
  • zmsentities/src/Zmsentities/Process.php
🧬 Code graph analysis (1)
zmsdb/src/Zmsdb/Query/Process.php (1)
zmsentities/src/Zmsentities/Process.php (3)
  • getAmendment (351-354)
  • getCustomTextfield (395-398)
  • getCustomTextfield2 (409-412)
🔇 Additional comments (5)
zmsadmin/templates/block/appointment/form.twig (1)

396-406: LGTM - textarea conversion properly implemented.

The conversion from input to textarea for customTextfield2 is correctly implemented with appropriate constraints preserved (maxlength, value binding, accesskey).

zmsentities/src/Zmsentities/Process.php (3)

391-391: LGTM - trimmed value properly stored.

The amendment is now correctly trimmed and the result stored back to the property, preventing unwanted leading/trailing whitespace.


416-419: The code currently uses direct assignment (not concatenation) for customTextfield2, matching the identical pattern used in customTextfield. While the current behavior cannot be confirmed as a recent change based on available git history, the assessment of the current implementation is accurate: both methods directly assign the input value rather than concatenating it.


402-405: Remove or clarify the customTextfield assignment comment; the code shows replacement behavior (not a change from concatenation).

The customTextfield implementation uses direct replacement via assignment, not concatenation. The method is called only once during process initialization (line 186), and tests consistently show single-value usage. No evidence exists of prior concatenation behavior or code expecting multiple sequential calls to append values.

Likely an incorrect or invalid review comment.

zmsdb/src/Zmsdb/Query/Process.php (1)

894-896: Verify if unconditional assignment of amendment and custom text fields is intentional.

These three fields lack the conditional checks applied to other client data in this method. While the database columns allow NULL and the system has customTextfieldActivated preferences, the code does not check activation status before assigning values. Confirm whether this unconditional assignment—which will store values regardless of field activation status—is the intended behavior or if these assignments should be gated by scope preferences.

ThomasAFink
ThomasAFink previously approved these changes Dec 22, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
zmsadmin/templates/block/queue/table.twig (1)

161-172: Use explicit e('html_attr') for HTML attribute context escaping.

The title attribute receives decoded entities via decodeEntities|, which is not marked as a safe filter. While Twig's default autoescape for .twig files provides baseline protection, explicit attribute-context escaping is a defense-in-depth best practice and follows OWASP guidelines.

Apply this to all instances in the three tables (parked, queue, and missed lists):

Apply to customTextfield title attributes
- <td title="{{ item.customTextfield|decodeEntities }}" class="limited-width">
+ <td title="{{ item.customTextfield|decodeEntities|e('html_attr') }}" class="limited-width">
Apply to customTextfield2 title attributes
- <td title="{{ item.customTextfield2|decodeEntities }}" class="limited-width">
+ <td title="{{ item.customTextfield2|decodeEntities|e('html_attr') }}" class="limited-width">
🧹 Nitpick comments (1)
zmsadmin/templates/block/queue/table.twig (1)

722-726: Verify .limited-width actually constrains <td> width in your table layout.

Depending on existing table CSS, max-width on <td> may not bite unless the table uses a compatible layout (often table-layout: fixed and/or explicit column widths). Please verify in-browser for all three tables + responsive wrapper behavior.

Optional follow-up: consider moving this rule out of the Twig template into the project’s main stylesheet to keep presentation concerns centralized (Clean Code separation). Based on coding guidelines, separate concerns.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 175ecf4 and 8ca28cc.

📒 Files selected for processing (1)
  • zmsadmin/templates/block/queue/table.twig
🧰 Additional context used
📓 Path-based instructions (1)
**/*

⚙️ CodeRabbit configuration file

**/*: Apply the following Clean Code guidelines to all files, as summarized by wojteklu's Clean Code gist:

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

  1. Keep configurable data at high levels.
  2. Prefer polymorphism to if/else or switch/case.
  3. Separate multi-threading code.
  4. Prevent over-configurability.
  5. Use dependency injection.
  6. Follow Law of Demeter. A class should know only its direct dependencies.

Understandability tips

  1. Be consistent. If you do something a certain way, do all similar things in the same way.
  2. Use explanatory variables.
  3. Encapsulate boundary conditions. Boundary conditions are hard to keep track of. Put the processing for them in one place.
  4. Prefer dedicated value objects to primitive type.
  5. Avoid logical dependency. Don't write methods which works correctly depending on something else in the same class.
  6. Avoid negative conditionals.

Names rules

  1. Choose descriptive and unambiguous names.
  2. Make meaningful distinction.
  3. Use pronounceable names.
  4. Use searchable names.
  5. Replace magic numbers with named constants.
  6. Avoid encodings. Don't append prefixes or type information.

Functions rules

  1. Small.
  2. Do one thing.
  3. Use descriptive names.
  4. Prefer fewer arguments.
  5. Have no side effects.
  6. Don't use flag arguments. Split method into several independent methods that can b...

Files:

  • zmsadmin/templates/block/queue/table.twig
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: call-php-unit-tests / zmsdb-test
  • GitHub Check: call-zmsautomation-tests / zmsapiautomation
  • GitHub Check: call-php-unit-tests / zmsapi-test
🔇 Additional comments (2)
zmsadmin/templates/block/queue/table.twig (2)

424-435: Good: consistent width limiting + truncation for queue custom text fields.

This should prevent the table from being “blown up” by long values while still giving full content via tooltip. (See the escaping note on title from above.)


555-566: Good: missed-list custom text fields also constrained.

Nice to apply the same behavior consistently across parked/queued/missed lists.

@matthilo96 matthilo96 merged commit 2a7d2b3 into next Jan 19, 2026
41 checks passed
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.

5 participants