Can some one help me find the code for getting all disabled or enabled=no entities in entities database.
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 need to enable the hidden entities flag: http://reference.elgg.org/engine_2lib_2access_8php.html#a15794857a9e59613ff485226202b5b0d
Hi Matt
Thanks, simply I need to get the guid of all entities which are disabled, do we have any option to list through elgg_get_entity() ?
Can you help.
Yeah you can add:
$options['wheres'][] = "e.enabled = 'no'";
To the options for elgg_get_entities
How to make this work on elgg_get_entities_from_metadata?
I actually need to get only enabled entities but it returns all of them, even disabled ones.
here is code:
Leave away the wheres line
and it shouldn't return disabled entities.
I thought by default elgg_get_entities_from_metadata or elgg_get_entities returns only enabled entities but it does not.
That's why I found this thread and tried adding wheres but even with it does not work.
I'm trying to get ONLY enabled entities, NOT disabled.
I just tested with elgg_get_entities() and it works as expected.
Do you have a
before fetching the entities? If yes, this would result in also hidden (disabled) entities from getting returned.
If this is not the case, which version of Elgg do you use? Have you tried also on the latest version of Elgg if you're not using it at the moment anyway?
I don't have:
I think it could be elgg_get_entities_from_metadata, elgg_get_entities works fine but elgg_get_entities_from_metadata might be different.
Can you test with elgg_get_entities_from_metadata?
I'm on Elgg 1.8.20
I now also tested with elgg_get_entities_from_metadata() and it works as expected, i.e. disabled entities are not fetched. So, it works fine on Elgg 2.3.
I also tested on Elgg 1.8 and it ALSO works correct! So, I don't see any faulty behaviour in Elgg core.
Are you really sure that showing of hidden entities isn't enabled when you are fetching the entities? You could test with logging the access status in the error log by adding these lines before your usage of elgg_get_entities_from_metadata():
And you really should work on upgrading to a newer version of Elgg (at least 1.12 or even better 2.3) instead of staying on 1.8.
@iionly
I know, we have started upgrading custom plugins to 1.9 and then up but it is slow.
I think problem is these entities are created by admin so logged in as admin it pulls all of them.
This will be nooby question but is enabled entity same as access_id of the entity?
Access Id dropdown sets "enabled" or disabled status?
- Previous
- 1
- 2
- Next
You must log in to post replies.