Author: david
Date: Wed Nov 30 12:24:45 2011
New Revision: 10361
Log:
Merge r10355:10359 from trunk
Modified:
branches/dcb/ (props changed)
branches/dcb/config/rsync_exclude.txt
branches/dcb/data/fixtures/settings.yml
branches/dcb/images/logo.png (props changed)
branches/dcb/lib/task/migrate/QubitMigrate110.class.php
branches/dcb/plugins/qbAclPlugin/lib/vendor/Zend/ (props changed)
branches/dcb/plugins/sfDrupalPlugin/vendor/drupal/ (props changed)
branches/dcb/vendor/symfony/ (props changed)
branches/dcb/vendor/symfony/lib/task/i18n/sfI18nExtractPluginTask.class.php
(props changed)
branches/dcb/vendor/yui/ (props changed)
branches/ica-atom/ (props changed)
branches/ica-atom/apps/qubit/modules/actor/actions/contextMenuComponent.class.php
(props changed)
branches/ica-atom/config/rsync_exclude.txt
branches/ica-atom/data/fixtures/settings.yml
branches/ica-atom/favicon.ico (props changed)
branches/ica-atom/images/logo.png (props changed)
branches/ica-atom/lib/task/migrate/QubitMigrate110.class.php
branches/ica-atom/plugins/qbAclPlugin/lib/vendor/Zend/ (props changed)
branches/ica-atom/plugins/sfDrupalPlugin/vendor/drupal/ (props changed)
branches/ica-atom/vendor/symfony/ (props changed)
branches/ica-atom/vendor/symfony/lib/task/i18n/sfI18nExtractPluginTask.class.php
(props changed)
branches/ica-atom/vendor/yui/ (props changed)
Modified: branches/dcb/config/rsync_exclude.txt
==============================================================================
--- branches/dcb/config/rsync_exclude.txt Wed Nov 30 12:20:39 2011
(r10360)
+++ branches/dcb/config/rsync_exclude.txt Wed Nov 30 12:24:45 2011
(r10361)
@@ -13,6 +13,7 @@
/patches
/test
+/.htaccess
/index.php
/config/ProjectConfiguration.class.php
/apps/qubit/config/qubitConfiguration.class.php
Modified: branches/dcb/data/fixtures/settings.yml
==============================================================================
--- branches/dcb/data/fixtures/settings.yml Wed Nov 30 12:20:39 2011
(r10360)
+++ branches/dcb/data/fixtures/settings.yml Wed Nov 30 12:24:45 2011
(r10361)
@@ -3,7 +3,7 @@
name: version
editable: 0
deleteable: 0
- value: 74
+ value: 75
QubitSetting_2:
name: upload_dir
editable: 0
Modified: branches/dcb/lib/task/migrate/QubitMigrate110.class.php
==============================================================================
--- branches/dcb/lib/task/migrate/QubitMigrate110.class.php Wed Nov 30
12:20:39 2011 (r10360)
+++ branches/dcb/lib/task/migrate/QubitMigrate110.class.php Wed Nov 30
12:24:45 2011 (r10361)
@@ -85,6 +85,9 @@
case 73:
$this->addGlobalReplaceMenu();
+
+ case 74:
+ $this->ensurePublicationStatus();
}
// Delete "stub" objects
@@ -808,6 +811,56 @@
}
/**
+ * Ensure all information objects get an explicit publication status
+ *
+ * @return QubitMigrate110 SELF
+ */
+ protected function ensurePublicationStatus()
+ {
+ foreach ($this->data['QubitInformationObject'] as $key => &$item)
+ {
+ // Ignore ROOT
+ if ('<?php echo QubitInformationObject::ROOT_ID."\n" ?>' == $item['id'])
+ {
+ continue;
+ }
+
+ // Don't do anything if this node already has a publication status
+ if ($this->findRowKeyForColumnValue($this->data['QubitStatus'],
'object_id', $key) ||
+ $this->findRowKeyForColumnValue($this->data['QubitStatus'],
'object_id', $item['id']))
+ {
+ continue;
+ }
+
+ // Search up hierarchy for ancestor with status
+ $inheritedStatusKey = null;
+ $node = $item;
+
+ while (!isset($inheritedStatusKey))
+ {
+ $parentKey = $node['parent_id'];
+ $statusKey =
$this->findRowKeyForColumnValue($this->data['QubitStatus'], 'object_id',
$parentKey);
+
+ if ($statusKey)
+ {
+ $inheritedStatusKey = $statusKey;
+ }
+ else
+ {
+ $node = $this->data['QubitInformationObject'][$parentKey];
+ }
+ }
+
+ $this->data['QubitStatus']['QubitStatus_'.$key] = array(
+ 'object_id' => $key,
+ 'type_id' =>
$this->data['QubitStatus'][$inheritedStatusKey]['type_id'],
+ 'status_id' =>
$this->data['QubitStatus'][$inheritedStatusKey]['status_id']);
+ }
+
+ return $this;
+ }
+
+ /**
* Slugs are inserted when some resources are inserted, but slugs are dumped
* separately when data is dumped. So loading slug data will try to insert
* duplicate slugs. To work around this, turn slugs into resource properties
Modified: branches/ica-atom/config/rsync_exclude.txt
==============================================================================
--- branches/ica-atom/config/rsync_exclude.txt Wed Nov 30 12:20:39 2011
(r10360)
+++ branches/ica-atom/config/rsync_exclude.txt Wed Nov 30 12:24:45 2011
(r10361)
@@ -13,6 +13,7 @@
/patches
/test
+/.htaccess
/index.php
/config/ProjectConfiguration.class.php
/apps/qubit/config/qubitConfiguration.class.php
Modified: branches/ica-atom/data/fixtures/settings.yml
==============================================================================
--- branches/ica-atom/data/fixtures/settings.yml Wed Nov 30 12:20:39
2011 (r10360)
+++ branches/ica-atom/data/fixtures/settings.yml Wed Nov 30 12:24:45
2011 (r10361)
@@ -3,7 +3,7 @@
name: version
editable: 0
deleteable: 0
- value: 74
+ value: 75
QubitSetting_2:
name: upload_dir
editable: 0
Modified: branches/ica-atom/lib/task/migrate/QubitMigrate110.class.php
==============================================================================
--- branches/ica-atom/lib/task/migrate/QubitMigrate110.class.php Wed Nov
30 12:20:39 2011 (r10360)
+++ branches/ica-atom/lib/task/migrate/QubitMigrate110.class.php Wed Nov
30 12:24:45 2011 (r10361)
@@ -85,6 +85,9 @@
case 73:
$this->addGlobalReplaceMenu();
+
+ case 74:
+ $this->ensurePublicationStatus();
}
// Delete "stub" objects
@@ -808,6 +811,56 @@
}
/**
+ * Ensure all information objects get an explicit publication status
+ *
+ * @return QubitMigrate110 SELF
+ */
+ protected function ensurePublicationStatus()
+ {
+ foreach ($this->data['QubitInformationObject'] as $key => &$item)
+ {
+ // Ignore ROOT
+ if ('<?php echo QubitInformationObject::ROOT_ID."\n" ?>' == $item['id'])
+ {
+ continue;
+ }
+
+ // Don't do anything if this node already has a publication status
+ if ($this->findRowKeyForColumnValue($this->data['QubitStatus'],
'object_id', $key) ||
+ $this->findRowKeyForColumnValue($this->data['QubitStatus'],
'object_id', $item['id']))
+ {
+ continue;
+ }
+
+ // Search up hierarchy for ancestor with status
+ $inheritedStatusKey = null;
+ $node = $item;
+
+ while (!isset($inheritedStatusKey))
+ {
+ $parentKey = $node['parent_id'];
+ $statusKey =
$this->findRowKeyForColumnValue($this->data['QubitStatus'], 'object_id',
$parentKey);
+
+ if ($statusKey)
+ {
+ $inheritedStatusKey = $statusKey;
+ }
+ else
+ {
+ $node = $this->data['QubitInformationObject'][$parentKey];
+ }
+ }
+
+ $this->data['QubitStatus']['QubitStatus_'.$key] = array(
+ 'object_id' => $key,
+ 'type_id' =>
$this->data['QubitStatus'][$inheritedStatusKey]['type_id'],
+ 'status_id' =>
$this->data['QubitStatus'][$inheritedStatusKey]['status_id']);
+ }
+
+ return $this;
+ }
+
+ /**
* Slugs are inserted when some resources are inserted, but slugs are dumped
* separately when data is dumped. So loading slug data will try to insert
* duplicate slugs. To work around this, turn slugs into resource properties
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.