Elgg – making it better

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

  1. Logged into [Elgg] site
  2. Go to Tools – Files
  3. Go to Your Friends’ Files – http://[Elgg]/pg/file/acarer/friends/
    Files show up
  4. 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 cause:

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]);

to

if(!is_array($options[$singular])) $options[$plural] = array($options[$singular]);

else $options[$plural] = $options[$singular];


This entry was posted in ELGG, open source, social networking and tagged , , , , , . Bookmark the permalink.

2 Responses to Elgg – making it better

  1. This is a great work you do helping others to solve their elgg problems! I work with elgg also and I agree that contributing to make it a better product can help us all and it’s the best part of working with an open source platform.
    Thank you very much!

  2. Kien Vu says:

    Thanks for the kind feedback. Happy to hear that :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Brightcookie.com © 2011 | Accessibility | XHTML | CSS
Credits | Sitemap | Privacy | Disclaimer | RSS Feed | Contact
Last updated: 01-12-2010