Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag Report block conflicting Id's #5648

Closed
2 tasks done
kevinkrugerCCV opened this issue Oct 25, 2023 · 3 comments
Closed
2 tasks done

Tag Report block conflicting Id's #5648

kevinkrugerCCV opened this issue Oct 25, 2023 · 3 comments

Comments

@kevinkrugerCCV
Copy link

Description

The tag report block displays a grid to show all of the objects with the related tag. Used currently most commonly for a person, we would see a list of people that have the selected tag. When you select a person in the tag list you will either experience nothing as if the row is not selectable or in some cases you will be redirected to a person profile but it will not match the person selected.

Actual Behavior

After looking at the "TagReport.ascx.cs" file, I found that during the OnInit() and the BindGrid() the grid "DataKeyNames" are being initialized with the "EntityId". During the RowSelected function, the code uses the RowKeyId to look up the TaggedItem to first verify there is a TaggedItem record and would later look up the person tied to that tagged item record.

image

Due to the initialization function loading the DataKeyNames with the EntityId, during the row selected function, the RowKeyId on selected is passing the personId (EntityId) in to the function rather than the TaggedItemId. This is causing two different executions when selected.

  1. If the row selected has a personId that coincidentally matches a TaggedItemId, the row selection will open a person profile but it will not be the person selected.

  2. If the row selected has a personId higher than any taggedItemId record in the DB than no action will happen when selected.

The initial thought to fix was binding the DataKeyNames with the "Id" rather than the "EntityId" so when the selected row happens, the correct Id is passed in. By initializing with the Id of the taggedItem, the row selection functions as intended when selecting a person but by going this route, the communication functionality in the grid returns an error that there are no person's in the list.
image

The communication expects the Id in the grid to be a personId at that point but is a taggedId. The grid during bind function is setting the personIdField = "EntityId" but does not seem to be effecting the communication function.

In summary, if the grid is initialized with the dataKeyNames = "EntityId" than the row selection is broken and if the DataKeyNames = "Id" than the row selection works but the communication button does not work.

Expected Behavior

The expected behavior of this grid would be, if a row is selected, the browser is redirected to the tagged item (person/group). In addition, if a row is checked (or multiple checked) and the communication button in the upper row of the grid is selected that the browser will redirect to a communication block with the selected people.

Steps to Reproduce

image - Go to the tag report page (https://rock.rocksolidchurchdemo.com/people/tags) - Click on your custom tag created under the tag list available. - Select the persons row that you added the tag to. - See that nothing happens.

Issue Confirmation

  • Perform a search on the Github Issues to see if your bug or enhancement is already reported.
  • Try to reproduce the problem on a fresh install or on the demo site.

Rock Version

14.2

Client Culture Setting

en-US

@sparkdevnetwork-service sparkdevnetwork-service added the Status: In Dev Queue This issue is being worked on, and has someone assigned. label Oct 26, 2023
@kevinkrugerCCV
Copy link
Author

@Kwame-Agyei thank you! I put these changes in and tested locally but I get a null exception for the delete function now.
image

The two issues that were conflicting between row selection and communication seem to work with your fixes tho.

@Kwame-Agyei
Copy link
Collaborator

@kevinkrugerCCV The changes in this commit should fix the issue. Sorry for the inconvenience.

@kevinkrugerCCV
Copy link
Author

@kevinkrugerCCV The changes in this commit should fix the issue. Sorry for the inconvenience.

Great! thank you, that worked perfectly. I appreciate the fix!

@sparkdevnetwork-service sparkdevnetwork-service removed the Status: In Dev Queue This issue is being worked on, and has someone assigned. label Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants