Bug #241
closedOur current projectId method constantly fails when using multiple tabs
100%
Description
Currently, for almost all myamiweb/processing pages use $_SESSION['projectId']
to set the projectid for the python programs. This works in most cases, but if you have multiple tabs open with different projects, the $_SESSION variable could be set to any one of those projects.
Since all pages have an accurate $expId
obtained from the $_GET
variable, I propose that we use the function:
$projectId=getProjectFromExpId($expId); command .= "--project=$projectId";
in our functions.
Are there any problems with this method? Please comment otherwise I will make the change in the near future.
Updated by Neil Voss over 14 years ago
There are 60 lines of code in 50 different files that would be affected by this change.
Updated by Amber Herold over 14 years ago
The getProjectFromExpId function looks good to me. I say go for it!
Updated by Anchi Cheng over 14 years ago
This change is going to be a problem for uploading images to a new session which has no expId. It will have to have projectId assigned in the reloading of the page.
Updated by Neil Voss over 14 years ago
Anchi, Can we pass upload images the projectId? such as uploadimages.php?projectId=XXX
Updated by Anchi Cheng over 14 years ago
I just checked, it will mean that we have to stop using
$formAction=$_SERVER['PHP_SELF'];
in quite a lot of files, too.
Updated by Neil Voss over 14 years ago
Why is that? I see no reason to stop using $_SERVER['PHP_SELF'];
.
Updated by Neil Voss over 14 years ago
Also, if it is really a problem, we could do something like:
if ($_GET['expId']) $projectId=getProjectFromExpId($_GET['expId']); else $projectId=$_SESSION['projectId']; command .= "--project=$projectId";
Updated by Neil Voss over 14 years ago
- Target version set to Appion/Leginon 2.0.0
Updated by Eric Hou over 14 years ago
If all the pages can get projectID from $_GET, the there is no problem to use it. $_SESSION is only base on the last action user did. So it might get confuse sometimes.
Thanks.
Eric
Updated by Neil Voss over 14 years ago
- Status changed from Assigned to In Code Review
- Assignee changed from Neil Voss to Amber Herold
- % Done changed from 30 to 100
Updated by Amber Herold over 14 years ago
- Assignee changed from Amber Herold to Neil Voss
This looks like there is an unnecessary call to getProjectId() in runTemplateCorrelator.php line 49.
$projectId = getProjectId(); $formAction=$_SERVER['PHP_SELF']; // retrieve template info from database for this project if ($expId){ $projectId=getProjectId(); $formAction=$_SERVER['PHP_SELF']."?expId=$expId"; }
Updated by Neil Voss over 14 years ago
- Assignee changed from Neil Voss to Amber Herold
Updated by Amber Herold over 14 years ago
- Status changed from In Code Review to Closed
I'm closing this out and skipping test because the changes touch too many files to test specifically for this. These changes should be covered by the testing that is already taking place for the Appion 2.0 release.