aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-07-14 22:38:04 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-07-14 22:38:04 -0700
commit9b15dbde1cf4d89468fdc153324276c12e9f7ff0 (patch)
tree2f03f564f2cf2b6e9121073a045800ada5f45ad7
parent89fbfd2bf80bdd7f12ed5d188a1c6b38bb5b3712 (diff)
downloadvolse-hubzilla-9b15dbde1cf4d89468fdc153324276c12e9f7ff0.tar.gz
volse-hubzilla-9b15dbde1cf4d89468fdc153324276c12e9f7ff0.tar.bz2
volse-hubzilla-9b15dbde1cf4d89468fdc153324276c12e9f7ff0.zip
group fixes to import
-rw-r--r--mod/import.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/mod/import.php b/mod/import.php
index dd16593c1..02f62e646 100644
--- a/mod/import.php
+++ b/mod/import.php
@@ -201,9 +201,19 @@ function import_post(&$a) {
ref_session_write(session_id(), serialize($_SESSION));
}
}
- else
- $channel = $a->get_channel();
-
+ else {
+ $r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1",
+ intval(get_account_id()),
+ dbesc($channel['channel_guid'])
+ );
+ if($r)
+ $channel = $r[0];
+ else {
+ logger('mod_import: channel not found. ', print_r($channel,true));
+ notice( t('Cloned channel not found. Import failed.') . EOL);
+ return;
+ }
+ }
if($completed < 2) {
@@ -511,7 +521,7 @@ function import_post(&$a) {
}
$group_members = $data['group_member'];
- if($groups_members) {
+ if($group_members) {
foreach($group_members as $group_member) {
unset($group_member['id']);
$group_member['uid'] = $channel['channel_id'];