Hello, i like add new object of plugin pages for a group.this is correct??
the group guid are 857
$object = new ElggObject();
$object->subtype = 'page_top';
$object->description = 'lore ipsum';
$object->container_guid = '857';
$object->save();
thanks!!!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
you can either delete it and create a new one, or just fix by assigning an owner and container
Pages stores the content in annotations in order to store revisions and the views display the annotation values.
steve
is true in the annotations is not the page.
restore the installation I have no problem, thanks to rodolfo make backups;)
the problem as I have in the code, i dont know I'm writing.
what is owner_guid?
and container_guid?
if i put container_guid = 127 fatal mistake me
thanks to everybody, i m desperate.
i investigate the page plugin and i founda new.php
You need to delete entities you created with owner_guid = 0. Cash's DB validator may help here, or you can just delete the problem entity in the Elgg entities table.
thanks steve, but this is not the problem, i have backup of db, i try to make a plugin to export pages to other groups and i like create code for create one page_top.
sorry for my english!!!
The pages/edit action has the code that creates pages, though it's a little confusing because it also handles saving existing ones. But if you consider $page_guid will be 0, you can more clearly see what will run.
its ok!!! very thanks!!this is the code:
$page_guid = 0;
$parent_guid = 0;
/////////creacion de la pagina nueva ////////////////////
$variables = elgg_get_config('pages');
$page = new ElggObject();
$page->description = $descripcion;
$page->subtype = $subtipo;
$page->title = $titulo;
$page->description = $descripcion;
$new_page = true;
// need to add check to make sure user can write to container
$page->container_guid = $container_guid;
if ($parent_guid) {
$page->parent_guid = $parent_guid;
}
if ($page->save()) {
elgg_clear_sticky_form('page');
// Now save description as an annotation
$page->annotate('page', $descripcion, $page->access_id);
//SubPaginasTopLectura
funcionsubpaginas($name,$page->getGUID());
// Fin SubPaginasTopLectura
}
/////////Fin creacion de la pagina nueva ////////////////////
And this a funcion subpaginas (subpages)
- Previous
- 1
- 2
- Next
You must log in to post replies.