One of the gratifying things about working with open source solutions is being able to contribute towards making a product better.
For those of you currently using Elgg (a free, open source social networking engine), you may want to pass this post on to your technical support team.
In the course of testing an Elgg 1.7x site for one of our clients, we discovered that a sub menu in the Files area wasn’t functioning properly.
Below is a guide to replicating the issue and how we solved it. I hope you’ll find this useful.
We have also reported this as a bug to the ELGG Community and within an hour we were advised that it has been added to new code version of Elgg. You can view the report here: http://trac.elgg.org/ticket/2641
Replicating the issue
- Logged into [Elgg] site
- Go to Tools – Files
- Go to Your Friends’ Files – http://[Elgg]/pg/file/acarer/friends/
Files show up
- Click on submenu: All – http://[Elgg]/mod/file/search.php?subtype=file&md_type=simpletype&friends_guid=8532&page_owner=8532
NOTHING shows up
The reason is that the function elgg_get_entities() has this problem is that the owner_guid is an array of array ( this is caused by the elgg_normalise_plural_options_array() function)
How to fix it:
Open the file /engine/lib/elgglib.php
Look up for function: elgg_normalise_plural_options_array($options, $singulars)
Change the line
$options[$plural] = array($options[$singular]);
if(!is_array($options[$singular])) $options[$plural] = array($options[$singular]);
else $options[$plural] = $options[$singular];