From 709ec9d5ac032c4c08ac048917ca5f67b1caa0d6 Mon Sep 17 00:00:00 2001
From: Eric Rasmussen <erasmussen2@unl.edu>
Date: Mon, 15 Nov 2010 20:38:38 +0000
Subject: [PATCH] Patch for 1.7.3 bug

---
 README                               |  1 +
 patches/check_page_owner_exists.diff | 15 +++++++++++++++
 setup.sh                             |  2 +-
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 patches/check_page_owner_exists.diff

diff --git a/README b/README
index 03064f84..cd2b6f70 100644
--- a/README
+++ b/README
@@ -85,6 +85,7 @@ Just run the setup.sh script. If any plugins are added, add this to the setup.sh
 ** Patches
 *******
 All patches are located in the /pathces directory. These include:
+patches/check_page_owner_exists.diff    * check that $page_owner is set or a non-existant profile returns 500 error (FIXED IN 1.7.4)
 patches/relationship_get_set_public.diff  *__get __set not declared correctly
 patches/lowercase_post.diff           *Forms use POST which doesn't validate 
 patches/strip_tags_name_field.diff	  *Display Name field allowed html that often was not escaped upon output
diff --git a/patches/check_page_owner_exists.diff b/patches/check_page_owner_exists.diff
new file mode 100644
index 00000000..65973f0d
--- /dev/null
+++ b/patches/check_page_owner_exists.diff
@@ -0,0 +1,15 @@
+### Eclipse Workspace Patch 1.0
+#P UNL_Elgg
+Index: elgg/mod/profile/start.php
+===================================================================
+--- elgg/mod/profile/start.php	(revision 7321)
++++ elgg/mod/profile/start.php	(working copy)
+@@ -203,7 +203,7 @@
+ 			if (get_context() == "profile") {
+ 				$page_owner = page_owner_entity();
+ 
+-				if ($page_owner->canEdit()) {
++				if ($page_owner && $page_owner->canEdit()) {
+ 					add_submenu_item(elgg_echo('profile:editdetails'), $CONFIG->wwwroot . "pg/profile/{$page_owner->username}/edit/");
+ 					add_submenu_item(elgg_echo('profile:editicon'), $CONFIG->wwwroot . "pg/profile/{$page_owner->username}/editicon/");
+ 				}
diff --git a/setup.sh b/setup.sh
index 2ecb86f5..7befb4e9 100755
--- a/setup.sh
+++ b/setup.sh
@@ -8,7 +8,7 @@ patch -p0 -s -N  -r tmp.rej                   	< patches/relationship_get_set_pu
 patch -p0 -s -N -d elgg -r tmp.rej            	< patches/lowercase_post.diff              > /dev/null
 patch -p0 -s -N -d elgg/actions/user -r tmp.rej < patches/strip_tags_name_field.diff	   > /dev/null
 patch -p0 -s -N -d elgg/mod/groups -r tmp.rej 	< patches/add_closing_labels.diff          > /dev/null
+patch -p0 -s -N -d elgg/mod/profile -r tmp.rej 	< patches/check_page_owner_exists.diff     > /dev/null
 rm tmp.rej &> /dev/null
 
 echo 'Setup successful'
-
-- 
GitLab