Hi!
I'm trying to develope a plugin for counting and listing entities in ELGG (yes, i know, there are a lot of stuff done, and so far better than mine, but its for an university project).
I just did the votation, and now, when i want to add a global counter, i have a problem.
Even If i make a public metadata ( "create_metadata($ent->guid, "Total", $points, 'integer', 2,2);" ) this metadata its not editable/updatable by anyone (excluding the admin).
I mean, if i try to push a new value with a normal-user account, the value stay statics. If i try it with an admin acount, the value changes itself.
I'm really new to elgg, and i think that i'm doing something wrong, but what? I read the API and the DM, but i cant resolve this issue.
Can you help me please?
PS:Sorry about my english. Spanish dev.
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.
- aimash@aimthemask

aimash - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- Team Webgalli@webgalli

Team Webgalli - 0 likes
- Mike Zacher (vazco)@vazco

Mike Zacher (vazco) - 0 likes
You must log in to post replies.Hello,
If I am correct, you can try a plugin hook to override permission to edit metadata from an normal user,
It was something like this :
I think this should do what you want !
Regards,
Muhammad Aimash
The access level for a piece of metadata is locked to the access level for the associated entity by default (even if you try changing it to something else).
You can change that behaviour using the register_metadata_as_independent() function as is used in mod/profile/start.php, for example.
Personally I find independent metadata access levels confusing and would rather associate public metadata with a public entity but the feature can be useful sometimes.
Iff you are in need of a counter function only, you can also think about annotations as an alternative.
One of the simplest solutions for counters would be to use:
$counter = get_plugin_setting('counter','my_plugin');
//make calculations for counter if required
set_plugin_setting('counter',$counter,'my_plugin');