View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0005942 | mantisbt | customization | public | 2005-07-14 21:34 | 2019-01-10 02:34 |
| Reporter | selena | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | N/A |
| Status | new | Resolution | open | ||
| Product Version | 1.0.0a3 | ||||
| Summary | 0005942: string_custom_field_value - custom function | ||||
| Description | It would be nice to override custom field display in view.php. I specifically want to use this to perform calculations on required custom fields. To do this, I modified print_custom_field_value in core/custom_field_api.php and declared 'custom_function_default_string_custom_field_value' in core/custom_function_api.php Any feedback on whether this is the correct place to do this type of modification? Or is there an easier/better way to do this? | ||||
| Tags | No tags attached. | ||||
| Attached Files | custom_field_api.php.diff (715 bytes)
--- custom_field_api.php-orig Thu Jul 14 18:31:43 2005
+++ custom_field_api.php Thu Jul 14 17:54:37 2005
@@ -1248,7 +1248,12 @@
# $p_bug_id contains the bug id to display the custom field value for
# NOTE: This probably belongs in the print_api.php
function print_custom_field_value( $p_def, $p_field_id, $p_bug_id ) {
- echo string_custom_field_value( $p_def, $p_field_id, $p_bug_id );
+ $t_custom_field_value = helper_call_custom_function( 'string_custom_field_value', array( $p_def, $p_field_id, $p_bug_id ) );
+ if ( empty ($t_custom_field_value) ) {
+ echo string_custom_field_value( $p_def, $p_field_id, $p_bug_id );
+ } else {
+ echo $t_custom_field_value;
+ }
}
# --------------------
custom_function_api.php.diff (425 bytes)
--- custom_function_api.php-orig Thu Jul 14 18:30:37 2005
+++ custom_function_api.php Thu Jul 14 17:07:11 2005
@@ -15,6 +15,10 @@
### Custom Function API ###
+ # customizing a custom field
+ function custom_function_default_string_custom_field_value( $p_def, $p_field_id, $p_bug_id ) {
+ }
+
# --------------------
# Checks the provided bug and determines whether it should be included in the changelog
# or not.
| ||||
|
This customization way can be fine, we had nearly the same issue. Our solution was: core/custom_field_api.php:1453: function string_custom_field_value... we need the bug id for the custom field calculations, so maybe in the $g_custom_field_type_definition we can define #function_string_value_parameter or something like that can be a perfect solution. |
|
|
ok, you closed the new issue but i think we can upgrade the product version other hand it will be never resolved. thank you |
|
|
@smartmantis Product version represents the release in which the problem was reported / observed. It has nothing to do with if or when it would eventuelly be resolved. |
|