Group Custom Layout plugin

As per the posting guidelines, here's info about knowledge and comfort coding:
My distant "partner in crime" knows how to code (writes code for a living), but doesn't have much time to devote to our project. He's not familiar with elgg. I, on the otherhand, have the time, but I know very little about coding. I was successful in making some minor adjustments to a few elgg plugins. There are still a few things we'd like to do before we "launch".

First, I've been able to make some adjustments on the Group Custom Layout plugin https://elgg.org/plugins/384959 to make it work on our test site. The owner of a group can specify a background, color backgrounds, border color and title color for the widgets, but I get a WARNING:

WARNING: Deprecated in 1.9: \ElggEntity::getEntitiesFromRelationship takes an options array Called from [#12] /home/h04c9766/public_html/.com/engine/classes/ElggEntity.php:1003<br /> -> [#11] /home/h04c9766/public_html/oursite.com.com/mod/group_custom_layout/lib/functions.php:43

What do I need to do to correct this?

Thank you for any help you can give.

  • have a look at https://github.com/ColdTrick/group_custom_layout/blob/master/lib/functions.php#L43-L45 we've already fixed that problem, but there hasn't been a new release of the plugin.

    You can download it directly from GitHub to get the latest code

  • In case it gets necessary to fix other deprecation issues in future you can check out the reference site at http://reference.elgg.org/ to look up Elgg API functions and their attributes. For older versions of Elgg you can visit the corresponding sites, e.g. for Elgg 1.9 it would be http://reference.elgg.org/1.9/. The reference site has a search function you can use to find the info about certain functions, e.g.

    http://reference.elgg.org/classElggEntity.html#aed2e14f7db759a1b554af188627c56fe

    If an "options array" is mentioned, the new version of the functions requires an array with key => value pairs instead of a flat comma-separated list of parameters as used in former versions.

    You can also take a look in the folder vendor/elgg/elgg/engine/lib of the Elgg installation. In this directory you will see some files with names like deprecated-1.9.php. A lot of deprecation handling is done within the code of these files. If a plugin calls a function that got deprecated, there are mapping functions in these files (that also throw the deprecation warnings). You can take a look at these functions to see how you can update your code, i.e. how to use the new version of a function.

     

    The deprecation-X.X.php files don't contain all deprecated functions though. Sometimes the deprecations handling has to be done directly in the code of other files. In these cases it can help to use a fulltext search to find the corresponding deprecation warning.

  • Jerome Bakker, thank you! I made the change in the function.php and the warning message is gone. I have the pluging working on one test site, but only the colors working on another test site. My guess is that it has something to do with upload settings in some plugin. I'll compare the plugin settings on the two sites to see if I can figure out why I can't put a background on one and report back if I find out why.

    Thank you, iionly. I'm using a plugin called Code Analyzer to help identify problems https://elgg.org/plugins/1213751 I ran it on Group Tools and it is reporting a lot of Function call problems such as:

    Function call: get_site_secret (use of function marked private is unsafe)

    Function call: elgg_view_list_item (use of function marked private is unsafe)

    and so on. I'll use your links to see if I can figure out what to do.

    In the meantime, I'll probably post about some other things we'd like to get done.

    Thank you both again!

     

     

  • I changed the theme on the second site to the original aalborg theme and the Group Custom Layout plugin started working there, too. Someone with more experience would probably have found the solution much quicker, but I'm learning.

    Thank you again for all the help

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking