Skip to content

Conversation

@R0Wi
Copy link
Member

@R0Wi R0Wi commented Feb 26, 2023

Summary

Did some research to help fixing R0Wi-DEV/workflow_ocr#179 and found out, that the NC Vue component for system tags expect numeric ids as values (either a single tag id or an array of tag ids which are selected). The server API for workflows deliveres the system tag ids as strings:

image

The temporary fix is to convert them on clientside into integers.

TODO

  • Investigate why this error was introduced in NC25

Checklist

@szaimen szaimen requested review from a team, Pytal, artonge and szaimen and removed request for a team February 26, 2023 15:14
@szaimen szaimen added bug 3. to review Waiting for reviews labels Feb 26, 2023
@szaimen szaimen added this to the Nextcloud 26 milestone Feb 26, 2023
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @R0Wi,

Could you set a proper name to the issue and commit ?

The issue is that the values are saved in a generic string column in the DB. So they are returned as string by the API, as is it not possible to know in which type to cast them.

Your solution seem fine to me :)

@R0Wi R0Wi changed the title Fix #35645 Convert tag id to number (closing #35645) Feb 27, 2023
Fix for #35645

Signed-off-by: GitHub <[email protected]>
@R0Wi
Copy link
Member Author

R0Wi commented Feb 27, 2023

Could you set a proper name to the issue and commit ?

Done ✔️

The issue is that the values are saved in a generic string column in the DB. So they are returned as string by the API, as is it not possible to know in which type to cast them.

Yes already spotted this but I wondered why the problem came with NC 25 since I think there hasn't been changed much in this area? Maybe an update of the NC Vue components is responsible for this.

@artonge
Copy link
Contributor

artonge commented Feb 27, 2023

Thanks :)

Not sure.

Worth noting that we recently moved to a new select component: #36754 so it might be useful to check if the bug still occurs with it.

@R0Wi
Copy link
Member Author

R0Wi commented Feb 27, 2023

According to https://github.com/nextcloud/nextcloud-vue/blob/1ed5694799d108cc03e287c2215b14e56d7c4df5/src/components/NcSelectTags/NcSelectTags.vue#L241 and the logic there, the component still expects the passed value prop to be of type Number (or number-array in case of multiselect). Comparing that to the value prop of the current FileSystemTag.vue, I think we still need to convert from the workflowengine value representation (string) to the one expected by the NcSelectTags component (number).

@R0Wi R0Wi merged commit a3ab0ce into master Feb 28, 2023
@R0Wi R0Wi deleted the fix#35645 branch February 28, 2023 08:03
@R0Wi
Copy link
Member Author

R0Wi commented Feb 28, 2023

/backport stable25

@R0Wi
Copy link
Member Author

R0Wi commented Feb 28, 2023

@szaimen any chance to get this backported to NC 25?

@szaimen
Copy link
Contributor

szaimen commented Feb 28, 2023

/backport to stable25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File automated tagging - cannot select or use any tags as the conditions

5 participants