Setting Default Maniphest Fields sets Author

#1

Observed Behavior:

Edit the Maniphest Task form
Set the Field Defaults (Via Change Default Values)
Apply The Defaults
All new tasks are created with you as Author, other people creating new tasks now use you as author not themselves
(see a users phid in phabricator_search.search_editengineconfigurationtransaction table) for metadata {field.key.author}
Realize you have set the wrong default
So remove the author
(see newValue set to [] in phabricator_search.search_editengineconfigurationtransaction table) for metadata
Now create a new task
Author is not filled in
enter title, “Create New Task”
meets the following error

Unhandled Exception (“AphrontQueryException”)

#1048: Column ‘authorPHID’ cannot be null

Expected Behavior:

There should either be a “Current User” in the list of users (I couldn’t see one)
or removing the author should put back the author of the person creating the task

Phabricator Version:
phabricator eb26ba625c2706328413db48f4b7819dda38fa99 (Sat, Mar 9) (branched from c1bff3b8013e1d2d1293a8a843e15845edfd7194 on origin)

arcanist 9830c9316d38988b2dc283ac1a124b73bc8e6c5f (Thu, Mar 7)

phutil 6c64dce5f71c146204f9a40d084aabf77557d426 (Thu, Mar 7)

Reproduction Steps:
See above

0 Likes

#2

I resolved my issue by hand editing the json in mysql database table using mySQL workbench
in table phabricator_search.search_editengineconfiguration.properties to remove the “author” section completely from the “defaults” section.

… “defaults”:{“spacePHID”:“PHID-SPCE-xxxxx”,“author”:[],“owner”:[]

… “defaults”:{“spacePHID”:“PHID-SPCE-xxxxx”,“owner”:[]

The author of a task is now the “Current User”

Perhaps we need to be able to select “Current Viewer” in any “user” controls when setting the defaults

0 Likes

#3

I can’t reproduce any of the behavior you describe.

phabricator eb26ba625c2706328413db48f4b7819dda38fa99

This does not appear to be a commit in the upstream.

0 Likes

#4

look at the “branched from … on origin”

root@LinuxRND:/var/www/phab/phabricator# git show c1bff3b8013e1d2d1293a8a843e15845edfd7194
commit c1bff3b8013e1d2d1293a8a843e15845edfd7194
Author: epriestley git@epriestley.com
Date: Wed Mar 6 09:32:31 2019 -0800

0 Likes

#5

Since the commit isn’t in the upstream, it means the user has local patches – possibly including a “hack something to make authors work differently, causing this bug” patch.

0 Likes

#6

That’s a fair point. they might have local mods that cause the issue, although I’ve also noticed that my local branch sometimes shows the same style message even though i have no (significant) local changes.

My local changes include a json file used to set the config and a bunch of archives in phabricator/src/applications/repository/engine/__tests__/data/

Anyways, sorry to hijack, valid point

0 Likes

#7

I do have some local commits but not in this area to my knowledge, I’ve worked around the issue so I’m good for now. If its a true bug it will raise its head again, so forget about it for now.

But I would ask just one more question, if we are setting the defaults for a task it will show yourself as the user as the author field
If you remove the author then re add yourself as the author does it :

a) Think you should be the default author for all new tasks (even when you didn’t create them)
b) Realise you are the “Current Viewer” and not set that as the default?

If a) what is the process of getting back to not having an author is it to remove the author?

When I did that and tried to create a new task I met the no authorPHID column issue

Just in case me repo steps were not clear.

MyDeveloperDay

0 Likes

#8

if we are setting the defaults for a task it will show yourself as the user as the author field

I can’t reproduce this. There is no “Author” field in my defaults.

My expectation is that the “Author” field is immutable, and always set to the user who actually authored the task. You are not supposed to be able to create a task with a different user as the “Author”.

0 Likes

#9

Here’s what I see locally: there is no “Author” field.

0 Likes

#10

Thank you for your time, you where correct I brought this on myself by introducing the ability for a bot to change the author of a task

We use this to allow a bot to make task for bug logged in an external system and change the author after the event, mapping the username from external system to Phabricator user

Sorry to waste your time.

0 Likes

closed #11
0 Likes