BiologicalRecordsCentre / NPMS

NPMS
0 stars 0 forks source link

Qustionnaire field value is not getting the right value when saving user data. #326

Open BirenRathod opened 3 months ago

BirenRathod commented 3 months ago

There is a field_requested_questionnaires (Requested Questionnaires) field in user fields. After updating user data when saving it sends error message. This could be due to new Drupal 10 entity.

Screenshot ... image

andrewvanbreda commented 3 months ago

Hi @BirenRathod ,

Oli has marked this as low so I won't be investigating this in detail in near future.

A couple of quick thoughts though,

If we look at the type of the field_requested_questionnaires field, it is listed as "Webform Reference type: Webform"

I don't know anything much about that, other than it is going to be more complex than say something simple like an integer as is therefore more liable to going wrong.

I notice that the webform functionality looks like it is provided by modules. In particular "Webform Anonymizer 1.0.0" is listed as no longer supported in the modules updates list.

I can only come to the conclusion that is being used by the survey questionnaire (although I haven't checked), and if it is, the survey questionnaire may need alteration to some extent.

That is obviously only a quick theory, but it is roughly the same as your idea that it is a Drupal update problem.

Until someone is available to investigate that, perhaps it might be an idea to remove the questionnaire link from the website if you think this is happening to all users, maybe show a little note saying the questionnaire isn't available right now. You probably want to check @Sam-Amy thoughts on that though.

Also keep mind mind the code that warns the user they haven't filled in the survey will still be running, so that would need disabling in the volunteers_questionnaires module, or if it is left running, need to make sure the checkbox the user can select to avoid getting warnings is still available to the user.

sacrevert commented 3 months ago

I forget who worked on this originally, but if it was @BirenRathod then I am happy for Biren to use NPMS project time to fix it (if you need more hours let me know). @andrewvanbreda has other NPMS work and priorities at the moment though.

BirenRathod commented 3 months ago

@andrewvanbreda it should be a reference to the webform and then in the setting, for this field, the webform should be selected as "NPMs questionnaire". The webform Anonymizer 1.0 name is the same as the one Drupal created years ago and I just overtook its functionality, so nothing to do with the supported module bit. So just ignore that part.

Also, I just tested with other users and it works fine but only one user is having this issue. And it seems like there must be some undesirable value stored in the database for this user. so I will investigate this.

andrewvanbreda commented 3 months ago

@BirenRathod OK no problem, my thoughts were only quick notes having quickly read the issue. I guess if just one user, it is lower priority problem ,and doesn't require disabling the survey.