diff options
author | Juho Jaakkola <juho.jaakkola@mediamaisteri.com> | 2013-04-18 11:31:19 +0300 |
---|---|---|
committer | Juho Jaakkola <juho.jaakkola@mediamaisteri.com> | 2013-04-19 18:12:41 +0300 |
commit | 2e132718f5d38eb0cdb23aaa0bc888a33c123d4e (patch) | |
tree | 23bc6309aba3d4732cfbeb0645cdef0b7192ce3d /mod | |
parent | 21d8d10c3a3e974f1dfc110ad55e09a1d4db98c9 (diff) | |
download | elgg-2e132718f5d38eb0cdb23aaa0bc888a33c123d4e.tar.gz elgg-2e132718f5d38eb0cdb23aaa0bc888a33c123d4e.tar.bz2 |
Fixes 5370: Uses correct container when adding files through embed.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/embed/start.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mod/embed/start.php b/mod/embed/start.php index e8a3f8c14..2ece9d2c4 100644 --- a/mod/embed/start.php +++ b/mod/embed/start.php @@ -39,10 +39,12 @@ function embed_longtext_menu($hook, $type, $items, $vars) { } $url = 'embed'; - if (elgg_get_page_owner_guid()) { - $url = 'embed?container_guid=' . elgg_get_page_owner_guid(); + + $page_owner = elgg_get_page_owner_entity(); + if (elgg_instanceof($page_owner, 'group') && $page_owner->isMember()) { + $url = 'embed?container_guid=' . $page_owner->getGUID(); } - + $items[] = ElggMenuItem::factory(array( 'name' => 'embed', 'href' => $url, @@ -95,7 +97,12 @@ function embed_page_handler($page) { $container_guid = (int)get_input('container_guid'); if ($container_guid) { - elgg_set_page_owner_guid($container_guid); + $container = get_entity($container_guid); + + if (elgg_instanceof($container, 'group') && $container->isMember()) { + // embedding inside a group so save file to group files + elgg_set_page_owner_guid($container_guid); + } } echo elgg_view('embed/layout'); |