[dvlug] Elgg PHP Plugin Patch

Grant Bowman grantbow at ubuntu.com
Fri Sep 2 09:56:42 PDT 2011


Anyone skilled in php have a little time and interest in fixing and
testing a little code?

Grant


---------- Forwarded message ----------
From: "Joe Bogner" <joebogner at gmail.com>
Date: Aug 31, 2011 5:25 AM
Subject: Re: [Dev] CRITICAL - front page disappear
To: "Tiffany von Emmel" <vonemmel at dreamfish.com>

All,
This is fixed. The problem was that a bookmark was created to the
DF_Home page around the same time that the content changed. The
content was fine, it was the bookmark that caused the problem.
The bookmark caused the issue because our code searched for an ELGG
object named DF_Home and pulls the content from that object for the
home page:
See these lines:
https://github.com/dreamfish/elgg/blob/master/mod/dreamfish_theme/start.php#L85
https://github.com/dreamfish/elgg/blob/master/mod/dreamfish_theme/start.php#L134
Apparently a bookmark to a page also has the same title as the page.
Using the 'magic page name' is certainly fragile...
Some logic should be added after line 132 to limit it to subtype 9
(Page, I think) and possibly container_guid = 103 (Community). That
would make it better, but not a true fix. I'd have to think of
alternatives on how to pull the page from ELGG.
If someone wants to take this and wants to share their approach to
fixing it with the list, I'd be glad to participate in that.
Thanks,
Joe

While debugging, I grabbed this array of data for what's returned on
Line 132 (if it helps)
array(2) { [0]=> object(ElggObject)#264 (6) {
["attributes":protected]=> array(14) { ["guid"]=> string(5) "24832"
["type"]=> string(6) "object" ["subtype"]=> string(2) "16"
["owner_guid"]=> string(5) "23485" ["container_guid"]=> string(5)
"23485" ["site_guid"]=> string(1) "1" ["access_id"]=> string(1) "2"
["time_created"]=> string(10) "1314757484" ["time_updated"]=>
string(10) "1314757484" ["enabled"]=> string(3) "yes"
["tables_split"]=> int(2) ["tables_loaded"]=> int(2) ["title"]=>
string(18) "Dreamfish: DF_Home" ["description"]=> string(0) "" }
["url_override":protected]=> NULL ["icon_override":protected]=> NULL
["temp_metadata":protected]=> array(0) { }
["temp_annotations":protected]=> array(0) { }
["valid":"ElggEntity":private]=> bool(false) } [1]=>
object(ElggObject)#268 (6) { ["attributes":protected]=> array(14) {
["guid"]=> string(3) "108" ["type"]=> string(6) "object" ["subtype"]=>
string(1) "9" ["owner_guid"]=> string(1) "3" ["container_guid"]=>
string(3) "103" ["site_guid"]=> string(1) "1" ["access_id"]=>
string(1) "2" ["time_created"]=> string(10) "1266079578"
["time_updated"]=> string(10) "1314787699" ["enabled"]=> string(3)
"yes" ["tables_split"]=> int(2) ["tables_loaded"]=> int(2) ["title"]=>
string(7) "DF_Home" ["description"]=> string(2447) "


On Wed, Aug 31, 2011 at 12:54 AM, Tiffany von Emmel
<vonemmel at dreamfish.com> wrote:
>
> >
> > Hi,
> >
> > The front page view of Elgg site is blank.
> >
> > When Grant and I made a tiny tweak to c...
>
> > _______________________________________________
> > Dev mailing list
> > Dev at lists.dreamfish.com
> > htt...

_______________________________________________
Dev mailing list
Dev at lists.dreamfish.com
http://lists.dreamfish.com/mailman/listinfo/dev



More information about the dvlug mailing list