Bug #241
closed
Our current projectId method constantly fails when using multiple tabs
Added by Neil Voss over 14 years ago.
Updated over 14 years ago.
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.
There are 60 lines of code in 50 different files that would be affected by this change.
The getProjectFromExpId function looks good to me. I say go for it!
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.
Anchi, Can we pass upload images the projectId? such as uploadimages.php?projectId=XXX
I just checked, it will mean that we have to stop using
$formAction=$_SERVER['PHP_SELF'];
in quite a lot of files, too.
Why is that? I see no reason to stop using $_SERVER['PHP_SELF'];
.
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";
- Target version set to Appion/Leginon 2.0.0
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
- % Done changed from 0 to 10
- % Done changed from 10 to 30
- Status changed from Assigned to In Code Review
- Assignee changed from Neil Voss to Amber Herold
- % Done changed from 30 to 100
- 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";
}
- Assignee changed from Neil Voss to Amber Herold
- 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.
Also available in: Atom
PDF