Master/Detail in Multiple Browser Tabs

Post Reply
Adam
User
Posts: 480

Master/Detail in Multiple Browser Tabs

Post by Adam »

Many users of PHPM sites need to work on multiple records at the same time, so they open them in different browser tabs, but this can result in data corruption if master-detail tables are involved.

Imagine that you have a parent table (Companies) and a detail table (Staff)…

Begin on the list page of the Companies table, then:

1) view Company #1 in a new tab and click the “Staff” button to display the Company #1 employee records (master-detail page)
2) view Company #2 in a new tab and click the “Staff” button to display the Company #2 employee records (master-detail page)
3) switch to the Company #1 tab and click the “Add” button to add a new employee under Company #1

When that new employee record is saved:

a) it will actually be assigned to Company #2 when it should be assigned to Company #1
b) the master-detail page that displays after saving the record will show Company #2 information (along with the incorrectly-assigned employee record) – not Company #1 information as it should

This is because PHPM is taking the parent ID from the session, rather than from a hidden input / GET parameter passed through from the parent page.

The "session" approach is fine if users could be restricted updating one parent record at a time... but that's not possible.

There is a similar issue when editing detail records…

Begin on the list page of the Companies table, then:

1) view Company #2 in a new tab, click the “Staff” button to display the Company #2 employee records (master-detail page) and edit one of them
2) view Company #1 in a new tab and click the “Staff” button to display the Company #1 employee records (master-detail page)
3) switch back to the tab showing the edit page of the Company #2 employee

When saving that employee record:

a) it will be re-assigned to Company #1 when it should stay under Company #2
b) the master-detail page that displays afterwards shows Company #1 (and the re-assigned employee record) rather than the Company #2 details (the company that was being updated)

Please implement a secure fix for this issue ASAP.


Webmaster
User
Posts: 9425

Post by Webmaster »

Try v12.0.2.


Ab Coude
User
Posts: 1

Post by Ab Coude »

Hi Adam,

We encounter the same Session issues when working with multiple tabs within the same web browser.
Permalink URL's to a PHPMaker page, which are for example opened from a desktop or an e-mail, into a browser which already had a PHPMaker session running - also alters the session data (logically), creating problems for the previous page which was already opened.

I was wondering if v12.0.2 or higher has solved this issue (I can't find anything about it) - or that you perhaps found a work around.

Thanks,

Ab


Adam
User
Posts: 480

Post by Adam »

In v9, we resolved it with a simple edit of setSessionValue($v) / getSessionValue($v) and some jQuery dropped into the site footer.

It's worked immensely well and should be a simple fix for v12, but I'm hoping that v12 already handles it - I guess I'll find out soon enough :-)


Post Reply