When One Page Profile is installed, Profile Permission fails to hide restricted profile fields. Here's a patch that fixes it.

Comments

jgreep’s picture

If there aren't any fields left to view, there's an empty fieldset. It's not a proper patch, so feel free to modify it:

Index: profile_permission.module
===================================================================
--- profile_permission.module   (revision 7272)
+++ profile_permission.module   (working copy)
@@ -146,6 +146,10 @@
           unset($form[$category][$key]);
         }
       }
+      // Remove the whole category if the only elements left are the type, title, and weight
+      if (count($form[$category]) <= 3) {
+        unset($form[$category]);
+      }
       break;
     }
   }
tuffnatty’s picture

jgreep: How is this related to the issue title? I think your patch fixes another problem and should be filed as a separate issue.

jgreep’s picture

It seemed to make sense at the time. I've created a new issue as requested #790452: When there are no elements left, the category should be removed..

ilo’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
StatusFileSize
new848 bytes

I can confirm it works, not sure if the patch still applies so I reroll against HEAD, but this is a good fix for the issue.

boombatower’s picture

Status: Needs review » Fixed

Committed.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pianomansam’s picture

Version: 6.x-1.x-dev » 6.x-1.2
Status: Closed (fixed) » Needs review

This issue still appears to be unresolved in Profile Permission 6.x-1.2 and One Page Profile 6.x-1.13

The "break" on line 178 appears to be the culprit. When I commented out that line everything appeared to be working properly in One Page Profile.

Status: Needs review » Needs work

The last submitted patch, profile_permission_772570.patch, failed testing.