However, I am reluctant to run CVS HEAD on a production system, for various reasons. For one, I don't know for sure whether the database schema has been finalized, and I don't want the headache of manually migrating 2.0.0 data into an unsupported schema, then having to migrate again when OCS 2.1 comes out. Also, the development code has just entered testing for OCS 2.1, which suggests I would encounter a different set of bugs.
Therefore, I'm posting the following patch backporting some critical bugfixes that I have found from CVS to 2.0.0-1. If anyone has more bugfixes that need to be backported, please post them here as well. (To limit the scope of this thread, please stick to backports of critical fixes from CVS only.)
If the OCS team has the resources, it would be nice if you could release an OCS 2.0.1 while we are waiting for OCS 2.1. As it currently stands, OCS 2.0.0-1 is unsuitable for production use, and having a reliable release of the 2.0 branch would be helpful even if a 2.1 release is imminent.
- Code: Select all
--- ocs-2.0.0-1/dbscripts/xml/ocs_schema.xml.backport 2008-02-25 11:18:36.000000000 -0800
+++ ocs-2.0.0-1/dbscripts/xml/ocs_schema.xml 2008-03-05 03:03:28.942422000 -0800
@@ -933,7 +933,4 @@
<NOTNULL/>
</field>
- <field name="type" type="I1">
- <NOTNULL/>
- </field>
<field name="stage" type="I1">
<NOTNULL/>
@@ -1766,7 +1763,4 @@
</field>
<field name="original_file_name" type="C2" size="90"/>
- <field name="type" type="C2" size="40">
- <NOTNULL/>
- </field>
<field name="date_uploaded" type="T">
<NOTNULL/>
@@ -1819,7 +1819,4 @@
<AUTOINCREMENT/>
</field>
- <field name="key_hash" type="C2" size="40">
- <NOTNULL/>
- </field>
<field name="date_created" type="T">
<NOTNULL/>
--- ocs-2.0.0-1/classes/payment/ocs/OCSPaymentManager.inc.php.backport 2007-05-16 21:26:33.000000000 +0000
+++ ocs-2.0.0-1/classes/payment/ocs/OCSPaymentManager.inc.php 2008-02-27 10:42:32.000000000 +0000
@@ -47,5 +47,5 @@
}
- function fulfillQueuedPayment(&$queuedPayment) {
+ function fulfillQueuedPayment($queuedPaymentId, &$queuedPayment) {
if ($queuedPayment) switch ($queuedPayment->getType()) {
case QUEUED_PAYMENT_TYPE_REGISTRATION:
@@ -59,5 +59,5 @@
$queuedPaymentDao =& DAORegistry::getDAO('QueuedPaymentDAO');
- $queuedPaymentDao->deleteQueuedPayment($queuedPayment);
+ $queuedPaymentDao->deleteQueuedPayment($queuedPaymentId);
return true;
}
--- ocs-2.0.0-1/classes/payment/QueuedPaymentDAO.inc.php.backport 2007-05-08 23:16:43.000000000 +0000
+++ ocs-2.0.0-1/classes/payment/QueuedPaymentDAO.inc.php 2008-02-27 10:43:36.000000000 +0000
@@ -93,8 +93,8 @@
}
- function deleteQueuedPayment(&$queuedPayment) {
+ function deleteQueuedPayment($queuedPaymentId) {
return $this->update(
'DELETE FROM queued_payments WHERE queued_payment_id = ?',
- array($queuedPayment->getQueuedPaymentId())
+ array($queuedPaymentId)
);
}
--- ocs-2.0.0-1/classes/payment/PaymentManager.inc.php.backport 2007-05-08 23:16:43.000000000 +0000
+++ ocs-2.0.0-1/classes/payment/PaymentManager.inc.php 2008-02-27 10:41:35.000000000 +0000
@@ -62,5 +62,5 @@
}
- function fulfillQueuedPayment(&$queuedPayment) {
+ function fulfillQueuedPayment($queuedPaymentId, &$queuedPayment) {
fatalError('ABSTRACT CLASS');
}
--- ocs-2.0.0-1/plugins/paymethod/paypal/PayPalPlugin.inc.php.backport 2007-05-08 23:16:44.000000000 +0000
+++ ocs-2.0.0-1/plugins/paymethod/paypal/PayPalPlugin.inc.php 2008-02-27 10:45:51.000000000 +0000
@@ -201,5 +201,5 @@
// Fulfill the queued payment.
- if ($ocsPaymentManager->fulfillQueuedPayment($queuedPayment)) exit();
+ if ($ocsPaymentManager->fulfillQueuedPayment($queuedPaymentId, $queuedPayment)) exit();
// If we're still here, it means the payment couldn't be fulfilled.
--- ocs-2.0.0-1/pages/presenter/SubmitHandler.inc.php.backport 2007-04-10 13:45:11.000000000 -0700
+++ ocs-2.0.0-1/pages/presenter/SubmitHandler.inc.php 2008-03-04 23:42:42.577046000 -0800
@@ -22,4 +22,23 @@
*/
function submit($args) {
+ $user =& Request::getUser();
+ $schedConf =& Request::getSchedConf();
+ if ($user && $schedConf && !Validation::isPresenter()) {
+ // The user is logged in but not a presenter. If
+ // possible, enroll them as a presenter automatically.
+ import('schedConf.SchedConfAction');
+ $schedConfAction =& new SchedConfAction();
+ if ($schedConfAction->allowRegPresenter($schedConf)) {
+ $role =& new Role();
+ $role->setSchedConfId($schedConf->getSchedConfId());
+ $role->setConferenceId($schedConf->getConferenceId());
+ $role->setRoleId(ROLE_ID_PRESENTER);
+ $role->setUserId($user->getUserId());
+
+ $roleDao =& DAORegistry::getDAO('RoleDAO');
+ $roleDao->insertRole($role);
+ }
+ }
+
parent::validate();
parent::setupTemplate(true);
--- ocs-2.0.0-1/classes/submission/presenter/PresenterAction.inc.php.backport 2008-03-17 00:03:24.000000000 -0700
+++ ocs-2.0.0-1/classes/submission/presenter/PresenterAction.inc.php 2008-03-17 00:05:43.279134000 -0700
@@ -285,5 +285,5 @@
// Check director version
$directorFiles = $submission->getDirectorFileRevisions($paper->getCurrentStage());
- foreach ($directorFiles as $directorFile) {
+ if (is_array($directorFiles)) foreach ($directorFiles as $directorFile) {
if ($directorFile->getFileId() == $fileId) {
$canDownload = true;
