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

Child event fields are not updated when the Parent event's assigned user has been changed #8

Open
echantigny opened this issue Sep 15, 2020 · 1 comment

Comments

@echantigny
Copy link

Summary
When you change the assigned user for an event, then change information, the child events (attendees ones) are not modified.

Steps to reproduce

  • First create 3 users (ie: user1, user2, user3).
  • Login as user1
  • Create a client
  • Create an event. Assign it to user1 and invite user2. Add the client in the contexts
  • Modify the date of the event and check the database. Both events have the same date, which is fine.
  • Go to the client's view page and modify the event in the activity section directly (the popup window). Change the Assigned user to user3.
  • In the database, the parent event now as a calendarid for user3, but the organizer is still user1.
  • Go back to the event's view and modify the date again (still logged in as user 1)
  • You should see that now, the data is out of sync. Only the parent event is being updated. (see screenshot for my output)

Actual Result
The data is not being propagated to child events

Expected Result
For the data to always be in sync, no matter how the data of the parent is changed.

Details about your environment

  • OroPlatform version: 4.1.5
  • PHP version: 7.4.9
  • Database (MySQL, PostgreSQL) version: 10.4.14-MariaDB

Additional information
image

@echantigny
Copy link
Author

echantigny commented Sep 15, 2020

In

if ($calendarEvent->isOrganizer() === false && $calendarEvent->getParent() === null) {

You check if the isOrganizer is true, but in this case, the is_organizer field is set to 0 on both. Removing that if makes it all work again, but I don't know if there's any other implications I'm missing here.

In that IF, you also check get getParent() === null, which is always the case, you are currently validating a parent event.
EDIT: I think it could be !== null if you are currently updating a child event, but is that even possible ?

Also in

public function calculateIsOrganizer()

you don't switch the Organizer if the Assigned user changes, which means that you then have a assigned user that is not displayed anywhere and that can't change the event, but he's now the one owning the event. Because you assume that the assigned user is also the organizer when you first create the event, why is it not the case if you assign it to someone else after the fact?

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

No branches or pull requests

1 participant