Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Normal
Assignee:
Amber Herold
Category:
-
Target version:
Start date:
03/23/2010
Due date:
% Done:

100%

Estimated time:
Affected Version:
Show in known bugs:
Workaround:

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.

Actions #1

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.

Actions #2

Updated by Amber Herold over 14 years ago

The getProjectFromExpId function looks good to me. I say go for it!

Actions #3

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.

Actions #4

Updated by Neil Voss over 14 years ago

Anchi, Can we pass upload images the projectId? such as uploadimages.php?projectId=XXX

Actions #5

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.

Actions #6

Updated by Neil Voss over 14 years ago

Why is that? I see no reason to stop using $_SERVER['PHP_SELF'];.

Actions #7

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";
Actions #8

Updated by Neil Voss over 14 years ago

  • Target version set to Appion/Leginon 2.0.0
Actions #9

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

Actions #10

Updated by Neil Voss over 14 years ago

  • % Done changed from 0 to 10
Actions #11

Updated by Neil Voss over 14 years ago

  • % Done changed from 10 to 30
Actions #12

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
Actions #13

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";
    }

Actions #14

Updated by Neil Voss over 14 years ago

Yep, fixed in r13867.

Actions #15

Updated by Neil Voss over 14 years ago

  • Assignee changed from Neil Voss to Amber Herold
Actions #16

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.

Actions

Also available in: Atom PDF