I want to disable a river item, but not want to delete it , is the enable option is setting to "no" in entity table is the best idea for this ? Also how can i setup to show the disabled item for admin user only ?
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.
somebody, please help?
River table has it's own enabled column. I guess you could change the value there, though updating the database entries directly is discouraged, but I don't see any public API in core to do that.
You can disable an entity using:
@Ismayil Thanks
Why it is discouraged updating the database entry directly ? The problem is Iam using elgg 1.8 which doesn't support river item have its own enabled colom in database, can you provide a solution on this ?
Status updates trigger a series of hooks and events. If you update the database directly you may break data integrity that plugins maybe relying on. Disabling an entity is a recursive process - you will want all other entities contained by the entity disabled as well.
AFAIK none of the built-in Elgg pages show disabled entities. Before a query you can "turn them on" via access_show_hidden_entities(true) (not meant to be used by plugins!) to allow them to be found by queries, but I don't know how well they'll behave in the process of rendering them. We don't test this.
@Steve
would you please explain where we can call this function to make it work even as currently the entity is disabled in entities table, can you trace out that coding part ?
@Ismayil
Yes, that refers comments and likes of the content will also disabled as well is it?, can you shed an idea how can we achieve this ?is elgg_delete_river() is achieving same by keeping the integrity ?
Can you explain is it about setting enabled=no for the comments and likes of the entity in annotation and metadata table ?
Start by explaining what you are trying to do. You seem to be operating under wrong impressions about the data model.
River represents an event on the system and it references the actor and the object. Disabling or deleting a river has no effect on entities. You can have mutiple river entries for the same event (e.g. with different access levels).
Deleting or disabling an actor or an object will also delete ir disable all river items associated with it.
Deleting or disabling an entity will recursively delete or diable contained entities including comments. I am not sure about annotations off-hand.
@Ismayil Thanks for your feedback. I already represented it in my previous posts that
I want to disable a river item, but not want to delete it , is the enable option is setting to "no" in entity table is the best idea for this ?
But Iam using elgg 1.8 and it doesn't have option to disable the river item in river table but new version may have..
But when we set enable = no in entities table for the corresponding river item, it got hidden from the river list. why ?
Sorry I don't understand the above scenario can you please explain and how we can achieve it ?
Can anybody explain ? above ? having good knowledge in elgg core ?
- Previous
- 1
- 2
- Next
You must log in to post replies.