Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 118201 Details for
Bug 254429
Babel server blank plugin_id for deleted properties file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch that fixes #3
254429_mark_files_as_inactive.diff (text/plain), 3.70 KB, created by
Antoine Toulmé
on 2008-11-18 17:26:41 EST
(
hide
)
Description:
Patch that fixes #3
Filename:
MIME Type:
Creator:
Antoine Toulmé
Created:
2008-11-18 17:26:41 EST
Size:
3.70 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P babel_server >Index: classes/file/file.class.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/classes/file/file.class.php,v >retrieving revision 1.12 >diff -u -r1.12 file.class.php >--- classes/file/file.class.php 8 Oct 2008 13:58:14 -0000 1.12 >+++ classes/file/file.class.php 18 Nov 2008 22:26:04 -0000 >@@ -47,7 +47,7 @@ > version = " . $App->returnQuotedString($App->sqlSanitize($this->version, $dbh)) . ", > name = " . $App->returnQuotedString($App->sqlSanitize($this->name, $dbh)) . ", > plugin_id = " . $App->returnQuotedString($App->sqlSanitize($this->plugin_id, $dbh)) . ", >- is_active = 1" . $where; >+ is_active = " . $this->isActive . $where; > if(mysql_query($sql, $dbh)) { > if($this->file_id == 0) { > $this->file_id = mysql_insert_id($dbh); >@@ -68,7 +68,7 @@ > } > > function getFileID($_name, $_project_id, $_version) { >- $rValue = 0; >+ $rValue = -1; > if($this->name != "" && $this->project_id != "" && $_version != "") { > global $App, $dbh; > >Index: html/process_map_files.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/process_map_files.php,v >retrieving revision 1.12 >diff -u -r1.12 process_map_files.php >--- html/process_map_files.php 12 Nov 2008 18:21:38 -0000 1.12 >+++ html/process_map_files.php 18 Nov 2008 22:26:04 -0000 >@@ -33,6 +33,18 @@ > chdir("/tmp/tmp-babel") || die("Cannot use working directory"); > > >+$files = array(); >+$sql = "SELECT * from files"; >+$rs_files = mysql_query($sql, $dbh); >+while($myrow_file = mysql_fetch_assoc($rs_files)) { >+ $File = new File(); >+ $File->project_id = $myrow_file['project_id']; >+ $File->version = $myrow_file['version']; >+ $File->name = $myrow_file['name']; >+ $File->plugin_id = $myrow_file['plugin_id']; >+ $File->file_id = $myrow_file['file_id']; >+ $files[$File->file_id] = $File; >+} > > > $sql = "SELECT * FROM map_files WHERE is_active = 1 ORDER BY RAND()"; >@@ -40,6 +52,7 @@ > while($myrow_maps = mysql_fetch_assoc($rs_maps)) { > echo "Processing map file: " . $myrow_maps['filename'] . " in location: " . $myrow_maps['location'] . "\n"; > >+ > $tmpdir = "/tmp/tmp-babel/" . $myrow_maps['project_id']; > if(is_dir($tmpdir)) { > # zap the directory to make sure CVS versions don't overlap >@@ -109,11 +122,20 @@ > $file_name = trim(substr($out_line, 2)); > echo $html_spacer . $html_spacer . $html_spacer . "Processing .properties file: " . $file_name . "\n"; > >- $File = new File(); >- $File->project_id = $myrow_maps['project_id']; >- $File->version = $myrow_maps['version']; >- $File->name = $file_name; >- $File->plugin_id = $plugin_id; >+ $file_id = File->getFileID($file_name, $myrow_maps['project_id'], $myrow_maps['version']); >+ >+ if ($files[$file_id] != null) { >+ $File = $files[$file_id]; >+ $File->isActive = 1; >+ unset($files[$file_id]); >+ } else { >+ $File = new File(); >+ $File->project_id = $myrow_maps['project_id']; >+ $File->version = $myrow_maps['version']; >+ $File->name = $file_name; >+ $File->plugin_id = $plugin_id; >+ $File->isActive = 1; >+ } > if(!$File->save()) { > echo $html_spacer . $html_spacer . $html_spacer . $html_spacer . "***ERROR saving file: " . $file_name . "\n"; > } >@@ -135,6 +157,15 @@ > } > } > } >+echo "Marking the remaining files as inactive\n"; >+ >+foreach ($files as $file) { >+ $file->isActive = 0; >+ if(!$file->save()) { >+ echo $html_spacer . $html_spacer . $html_spacer . $html_spacer . "***ERROR saving file: " . $file->name . "\n"; >+ } >+} >+ > echo "Done."; > > if($headless) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 254429
: 118201