admin/broadcast: Error when changing sites on broadcast page

Issue #427 new
David Sutton created an issue

If a broadcast is selected in the dropdown menu, and the site is changed using the site-menu, an error will be displayed showing that the selected broadcast doesn’t exist. This happens because the broadcast from the previous site does not exist on the new site, and so cannot be found.

I see a few ways of handling this:

  • We ignore the error and don’t display it on the page (apart from the error the rest of the page loads to the expected state). However this means that we don’t see this error when we want to (ie. the broadcast actually fails to load)
  • We can be smarter when trying to load a previous broadcast by sensing that the broadcast exists, but not on this site, and then at that point we can ignore the error
  • We can handle the site-change event from the site-menu differently. Currently the site menu will trigger a page refresh when the site is changed, this is the root cause of the issue as it prompts the user to resubmit the form values. This could instead be presented as an event where individual pages can choose how to handle the event. On the broadcast page for example, this could trigger a value change of the broadcast select to the nil value, which would then load the page as expected.

In my opinion, the third option seems like the most correct way of handling this behaviour.

Comments (1)

  1. David Sutton reporter

    I have started implementing the 3rd option. It was simpler than I thought, I mainly need to focus on implementing the actions after the event for each page. The broadcast page acts as expected though.

  2. Log in to comment