Hello,
I am altering a SQL statement in the function get_entities_by_relationship_count in the relationships.php file in the 1.7 engine. I am adding the clause "where e.guid = $variable"
The variable is given the value of $vars['user'] -> site_guid. The problem is I do not think the $vars['user'] declaration has any value here. If I hard code the variable's intended value into the where clause (e.g. "356"), then everything works fine. But if I use the $vars['user'] to give the variable its value, I get no result. Any thoughts? Thank you.
[Moderator: this comment was off-topic. It was moved to a more appropriate topic.]
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.
- wink2010@wink2006
wink2010 - 0 likes
- Matt Beckett@Beck24
Matt Beckett - 0 likes
- Brett@brett.profitt
Brett - 0 likes
- Brett@brett.profitt
Brett - 0 likes
You must log in to post replies.Hello,
I am altering a SQL statement in the function get_entities_by_relationship_count in the relationships.php file in the 1.7 engine. I am adding the clause "where e.guid = $variable"
The variable is given the value of $vars['user'] -> site_guid. The problem is I do not think the $vars['user'] declaration has any value here. If I hard code the variable's intended value into the where clause (e.g. "356"), then everything works fine. But if I use the $vars['user'] to give the variable its value, I get no result. Any thoughts? Thank you.
I'm not entirely sure *where* you're trying to do this but perhaps you're looking for $vars['entity']->site_guid instead
First, it's generally a very bad idea to alter core functions, and the change you're talking about will break this function.
It's not working because $vars is only available in views.
What is your end goal? You can already specify the relationship guid and inverse the relationship, so I don't understand what you're trying to do.
[Moderator: this comment was off-topic. It was moved to a more appropriate topic.]
Also, please only post your question to a single forum. Asking multiple times splits the question and answers and makes it difficult for people to help you.