Workflow to update Users failing

Hello,

We are using 8.1
We created a custom module Staff (pkg1_staff) of type person with some additional fields.
Staff has a one to one relationship with Users.
We have a workflow to update the User record when the Staff record is saved.

The problem is, when we try to save, the workflow to update the User record fails on this code in actionCreateRecord.php

    if ($in_save) {
        global $current_user;
        $record->processed = true;
        $check_notify = $record->assigned_user_id != $current_user->id && $record->assigned_user_id != $record->fetched_row['assigned_user_id'];
    } else {
        $check_notify = $record->assigned_user_id != $record->fetched_row['assigned_user_id'];
    }

The error is that ‘assigned_user_id’ is not a valid field in Users table.

This implies to me that you cant have a one-to-one relationship between modules unless they have the assigned_user_id attribute.

Is this the case or are we missing something?
If it is the case, it doesnt seem right.
What are we missing?

Any help would be appreciated.

Thanks,
Arthur

HI Artur

We have a workflow to update the User record when the Staff record is saved.

Is that a new workflow? Or did that work in the past? – under 7 - or 8.0 -?

This implies to me that you cant have a one-to-one relationship between modules unless they have the assigned_user_id attribute.

Have you got other custom modules working OK, without this problem?

I may be wrong - but doesn’t every module have a bunch of required fields that includes assigned_user_id?

Others are : date_modified, modified by…etc

Hi,
We first created the workflow under 8.0.
We re-created it under 8.1, that is, we didnt migrate from 8.0 to 8.1 but did a fresh install.
We are not in production yet.
We didnt notice this error before, so either it was working before or we just didnt notice that it wasnt. This would be true for both 8.0 and 8.1.

We do have other another custom module that is working, but it doesnt have a relationship with the Users module.

The custom module does have assigned_user_id, date_modified, etc.
It is the Users table that does not have assigned_user_id and that is causing the problem.

Thanks,
Arthur

It would be interesting to test this exact same workflow in v7, I suppose the bug is there also…

We are unable to test on 7 - we dont have an installation at this time.
However, i quick look at the code should answer the question.