Add status constants and extension point for flexible user status management#525
Merged
Add status constants and extension point for flexible user status management#525
Conversation
Co-authored-by: alxndr-w <3855487+alxndr-w@users.noreply.github.com>
… callable Co-authored-by: alxndr-w <3855487+alxndr-w@users.noreply.github.com>
…tests Co-authored-by: alxndr-w <3855487+alxndr-w@users.noreply.github.com>
…ension point Co-authored-by: alxndr-w <3855487+alxndr-w@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update status choice field in rex_user callable
Add status constants and extension point for flexible user status management
Oct 14, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a flexible approach to managing YCom user status options by introducing status constants, a callable method with an extension point, and comprehensive documentation.
- Added status constants to replace magic numbers in code
- Implemented
getStatusOptions()method withYCOM_USER_STATUS_OPTIONSextension point - Updated YForm table definition to use callable for dynamic status options
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
lib/ycom_user.php |
Added status constants, default options array, and getStatusOptions() method with extension point |
install/tablesets/yform_user.json |
Updated choices field to use callable instead of hardcoded string |
tests/unit/user_status_test.php |
Added comprehensive unit tests for new status functionality |
docs/12_status_examples.md |
Created new documentation with usage examples and status table |
docs/05_passwords.md |
Enhanced existing documentation with status constants and extension examples |
docs/03_login_logout_profile_register.md |
Added informational note about status constants for form usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| ##### Status-Konstanten | ||
|
|
||
| Seit Version X.X werden die Status-Werte als Konstanten in der Klasse `rex_ycom_user` definiert. Diese können im Code verwendet werden, um die Lesbarkeit zu erhöhen: |
There was a problem hiding this comment.
The placeholder 'X.X' should be replaced with the actual version number when this feature is released.
Suggested change
| Seit Version X.X werden die Status-Werte als Konstanten in der Klasse `rex_ycom_user` definiert. Diese können im Code verwendet werden, um die Lesbarkeit zu erhöhen: | |
| Seit Version 2.7 werden die Status-Werte als Konstanten in der Klasse `rex_ycom_user` definiert. Diese können im Code verwendet werden, um die Lesbarkeit zu erhöhen: |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
AWqxKAWERbXo
left a comment
There was a problem hiding this comment.
Von meiner Seite aus so vorbereitet, wie ich denke, dass es eine Verbesserung ist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a more flexible approach to managing YCom user status options by introducing status constants, a callable method, and an extension point for project-specific customization.
Problem
Previously, status options were hardcoded as a long string in the YForm table definition:
This made it difficult to:
Solution
Following the pattern from FriendsOfREDAXO/warehouse, this PR adds:
1. Status Constants
2. Status Options Method with Extension Point
3. Callable in YForm Definition
Usage Examples
Using constants in code:
Extending status options via extension point:
Benefits
Changes
rex_ycom_userclassgetStatusOptions()method withYCOM_USER_STATUS_OPTIONSextension pointdocs/12_status_examples.md)Testing
Unit tests verify:
DEFAULT_STATUS_OPTIONScontains all expected entriesgetStatusOptions()returns proper array structureFixes #XXX
/cc @j4ceee
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c/usr/bin/php8.3 -n -c /tmp/LulFZE /usr/bin/composer install(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #524
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.