https://community.openproject.org/wp/49765https://community.openproject.org/wp/49784
Original bug was OP#49765: creating a list custom field and then adding
a comment to an existing work package would be impossible. An error
"<custom field> was attempted to be written but is not writable" was
displayed.
In WorkPackageContract, when evaluating what was changed by the user and
by the system, it checks if the custom values are newly set and if they
are default.
The default check was wrong for list custom field, as the default value
was an integer, and the value was a string (created automatically by
Redmine::Acts::Customizable#custom_field_values). i.e. check was `367 ==
"367"`
The default check was wrong for multi-value list custom field as well,
as the default value was a stringified array of integers, i.e. check was
`[367, 368] == "[367, 368]"`. And it is plain wrong anyway because two
CustomValue must be created in this case: one with value 367, second
with value 368. This prevented default values to be pre-selected in the
new work package form (bug #49784).
This commit fixes the default check by returning strings for default
value of list custom fields (bug #49765) and by creating multiple
CustomValue for multi-value list custom fields (bug #49784) when none is
present.
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.
Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
Only for list types, the value will be an integer to look up by id,
but instead use `CustomValue.new(...).typed_value` to use the formatter
classes to correctly look up the value.
https://community.openproject.com/wp/33496
[ci skip]
first charge of tests.
I intend those to fail for postgres, but can't verify that locally, so travis
will have to do it for me.
If you see this build failing for the newly added specs: This is intentional!