Author: david
Date: Fri Jun 24 21:31:48 2011
New Revision: 9182
Log:
Avoid PHP notices
Modified:
trunk/lib/task/migrate/MigrateTask.class.php
trunk/lib/task/migrate/QubitMigrate108.class.php
Modified: trunk/lib/task/migrate/MigrateTask.class.php
==============================================================================
--- trunk/lib/task/migrate/MigrateTask.class.php Fri Jun 24 17:31:59
2011 (r9181)
+++ trunk/lib/task/migrate/MigrateTask.class.php Fri Jun 24 21:31:48
2011 (r9182)
@@ -105,7 +105,7 @@
{
$this->migratePre108();
- if (null == $this->targetVerion || preg_match('/^\d+$/',
$this->targetVersion))
+ if (null == $this->targetVersion || preg_match('/^\d+$/',
$this->targetVersion))
{
$this->migrateFineGrained();
}
Modified: trunk/lib/task/migrate/QubitMigrate108.class.php
==============================================================================
--- trunk/lib/task/migrate/QubitMigrate108.class.php Fri Jun 24 17:31:59
2011 (r9181)
+++ trunk/lib/task/migrate/QubitMigrate108.class.php Fri Jun 24 21:31:48
2011 (r9182)
@@ -484,32 +484,35 @@
// Replace QubitAclAction::ACTION_ID constant with string
$pattern = '/QubitAclAction::([A-Z_]+)_ID/';
- foreach ($this->data['QubitAclPermission'] as $key => $row)
+ if (isset($this->data['QubitAclPermission']))
{
- if (0 < preg_match($pattern, $row['action_id'], $matches))
- {
- // Direct match in acl_permission.action_id column
- $action = strtolower($matches[1]);
- }
- else if (isset($this->data['QubitAclAction'][$row['action_id']]) && 0 <
preg_match($pattern, $this->data['QubitAclAction'][$row['action_id']]['id'],
$matches))
- {
- // Follow action_id row alias to QubitAclAction row, and match constant
- $action = strtolower($matches[1]);
- }
- else
+ foreach ($this->data['QubitAclPermission'] as $key => $row)
{
- continue;
- }
+ if (0 < preg_match($pattern, $row['action_id'], $matches))
+ {
+ // Direct match in acl_permission.action_id column
+ $action = strtolower($matches[1]);
+ }
+ else if (isset($this->data['QubitAclAction'][$row['action_id']]) && 0
< preg_match($pattern, $this->data['QubitAclAction'][$row['action_id']]['id'],
$matches))
+ {
+ // Follow action_id row alias to QubitAclAction row, and match
constant
+ $action = strtolower($matches[1]);
+ }
+ else
+ {
+ continue;
+ }
- // Switch 'view_draft' string to camelCase
- if ('view_draft' == $action)
- {
- $action = 'viewDraft';
- }
+ // Switch 'view_draft' string to camelCase
+ if ('view_draft' == $action)
+ {
+ $action = 'viewDraft';
+ }
- // Change name of `action_id` column to `action`
- $this->data['QubitAclPermission'][$key]['action'] = $action;
- unset($this->data['QubitAclPermission'][$key]['action_id']);
+ // Change name of `action_id` column to `action`
+ $this->data['QubitAclPermission'][$key]['action'] = $action;
+ unset($this->data['QubitAclPermission'][$key]['action_id']);
+ }
}
// Drop QubitAclAction table data
@@ -553,7 +556,7 @@
$nextKey = $key;
break;
}
- else if ('users' == $row['name'])
+ else if (isset($row['name']) && 'users' == $row['name'])
{
// Find the 'users' menu that is a child of the admin menu
if (strpos($row['parent_id'], 'QubitMenu::ADMIN_ID') ||
@@ -563,9 +566,9 @@
$userMenuKey = $key;
// Delete all children of user menu (users and groups)
- foreach ($this->data['QubitMenu'] as $key2 => $row2)
+ foreach ($this->data['QubitMenu'] as $key2 => $item)
{
- if ($userMenuKey == $this->data['QubitMenu'][$key2]['parent_id'])
+ if (isset($item['parent_id']) && $userMenuKey ==
$item['parent_id'])
{
unset($this->data['QubitMenu'][$key2]);
}
--
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.