View Issue Details

IDProjectCategoryView StatusLast Update
0025973mantisbtcustom fieldspublic2019-08-20 10:17
Reportercproensa Assigned Tocproensa  
PrioritynormalSeverityminorReproducibilityhave not tried
Status assignedResolutionopen 
Product Version2.22.0 
Summary0025973: custom_field_set_value() does not apply $p_log_insert
Description

The parameter $p_log_insert: whether it create log entries for the value change
is only used when inserting a new value.
It should also be used when updating an existing value.

TagsNo tags attached.

Activities

cproensa

cproensa

2019-08-15 09:21

developer   ~0062591

Last edited: 2019-08-16 21:03

PR https://github.com/mantisbt/mantisbt/pull/1544

removed from that PR

dregad

dregad

2019-08-16 03:54

developer   ~0062598

It should also be used when updating an existing value.

I'm not so sure, see my note in the PR.

cproensa

cproensa

2019-08-16 21:02

developer   ~0062602

This is @dregad note:

The PHPDoc says * * @param boolean $p_log_insert Create history logs for new values.*

So, the previous behavior is consistent with that. if we change it, then the PHPDoc needs to be updated accordingly.

Currently, this parameter is only used by mci_issue_set_custom_fields()

    when called from mc_issue_update() it is set to true
    when called from IssueAddCommand::process(), it is set to false.

In my opinion, it makes sense not to have a history entry when the issue is created, but it is correct to always have one whenever the custom field is updated (which if I'm not mistaken, is what the original implementation was doing).

Based on that, I believe that this change should not be merged. Unless I missed another use case ? If so, please explain the rationale

Being the lowest level entry point to update a custom field, i expected that the option to bypass history logs makes sense to be optional on both insert, and update, of the field value.
Other use cases, is updating custom fields from plugins. I have several plugins that use custom fields in a way that i'd rather not add history logs, because its data that is not directly intended for the user.