Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fago’s picture

Please don't let us any more UI options or duplicated UI efforts directly into the module - this should be solved by extension modules. We could think about adding one directly into the project though. Profile2 should just do it like the core profile module.

joachim’s picture

That's pretty much the point of this issue, agreed.

AFAIK at the moment there's no output of profiles at all, is there?

fago’s picture

yep, the profile is just shown on the user account page (as for core profiles)

fago’s picture

Status: Active » Closed (won't fix)

as of now, it should just work as the core profile module. If not, please reopen.

tim.plunkett’s picture

Status: Closed (won't fix) » Needs review

I made http://drupal.org/sandbox/tim.plunkett/1268178 as a proof of concept, if you want to pull it in as a submodule you are welcome to.

It's vaguely hacky, but I'm open to other ideas.

joachim’s picture

I've cloned and enabled it but I'm not seeing anything different -- where should I be looking?

joachim’s picture

Oh I see -- does it only work when 'Provide a separate page for editing profiles' is enabled for a profile type?

tim.plunkett’s picture

#7, yes. Not well documented, but that was the easiest way to do it quickly. Could probably be done better ways :)

fago’s picture

Category: bug » task
Status: Needs review » Needs work

I could see lots of people wanting this, so maybe it would be a good idea to add support for it in profile2_pages? It's basically just a special page location, not?

joachim’s picture

Yup.

There's two ways to do it:

A. Put profile2 tabs alongside user account tab, with View and Edit subtabs

B. Put profile2 tabs alongside user account tab. Keep the editing of each profile2 under the main user Edit tab.

Personally I think B looks better, and it means you edit everything together. But we should maybe try to get UX input on this?

drewkeller’s picture

Am I missing something? The Profile 2 tabs module above only consists of a single file that all it does is refer to profile2_page ???

I imagine the below two items are working as intended:

* If I enable "Provide a separate page" on a profile type, the only way I can see that profile type is by accessing its URL (e.g. /profile-main/[userid]).

* If I disable "Provide a separate page", the profile is represented as a display button (I would not call it a tab per se) on the profile in edit mode and as a div under an h3 heading in view mode.

At one time, I was able to see fields for the profile type as non-collapsible accordion sections of the core profile page. However, now I can't figure out what combination of settings provided that output.

fago’s picture

fago’s picture

Status: Needs work » Needs review
FileSize
14.53 KB

ok, I've implemented that.

For that to work, I needed to move profile_form() into the main profile2.module - that makes sense to me though. Please review and test the attached patch.

Note: The patch comes with a small API change: The flags to disable user-category integration or user-account-view changes. That shouldn't be a big deal though.

joachim’s picture

Status: Needs review » Needs work
+++ b/profile2.api.php
@@ -159,8 +159,8 @@ function hook_profile2_view_alter($build) {
   if (isset($types['main'])) {
-    $types['main']->userCategory = FALSE;
-    $types['main']->userView = FALSE;
+    $types['main']->data['user_edit_tab'] = FALSE;
+    $types['main']->data['user_view'] = FALSE;

Does this change in type settings need documenting in the api file?

fago’s picture

I'm not aware of any common place in the documentation file for documenting stuff like that. There is the possibility to document it directly in the entity class though, where it's already documented. Maybe we should add an @see classname to the hook_profile2_load() docs?

Any feedback on the UI? Should the tab be "Edit $foo" instead $foo?

joachim’s picture

I've applied the patch and I can't actually tell what's changed...

I see tabs for each profile type at user/1/edit, but I see those without the patch as well.

fago’s picture

There is a new option when editing a profile type, where you can choose the tab location.

joachim’s picture

Aha, I see!

So without the patch, the edit location is a secondary tab, and the view location is within the user page itself.

With the patch, the edit location can be chosen to be put either as a secondary or a primary.

But the thing is, primary tabs on the user should not be 'edity' things -- there is a UX bug open on the shortcuts tab being a primary.

If you put a profile as a primary, it should be view + edit as secondary within that separate primary.

fago’s picture

Hm, really? It edits something that's visible at the user account page though, just like edit. I think it's a quite common wanted feature, as the secondary tab is rather deeply nested and probably too difficult to find.

Maybe we should try to get some feedback directly from ux people on this?

joachim’s picture

Cellar Door’s picture

Sorry to jump in on this but I noticed that when putting in the 1.x of your module Tim that it left the page at profile-profile_name/uid invalid due to the hook_module_implementation you have. Taking this out it leaves the profiles accessible via the profile-name/uid but basically imports that page into the users account in the tabs.

I'm not sure if this is useful for everyone but in taking this out I was able to give a profile landing page for other users to visit still and not have to mess with users getting into the user/ pathways when visiting account profiles. Again, it may be specific to what I wanted to do (place blocks on profile pages for specific viewers etc.) but it also makes it so when clicking the profile title in the tab the user isn't lead to a non-existant page.

I was beating my head for hours looking at how to clean up the UX in editing the profile pages as the secondary tabs weren't very easy for a user to follow. This makes it nice and simple.

Thanks!

fago’s picture

Status: Needs work » Needs review
FileSize
13.19 KB

re-rolled the patch. Setting back to needs-review for as we need more feedback!

joachim’s picture

Status: Needs review » Needs work

When I saved a profile type to 'primary tab' I got:

Notice: Undefined index: user_edit_tab in profile2_menu() (line 517 of /Users/joachim/Sites/7-drupal/sites/all/modules/profile2/profile2.module).

fago’s picture

Status: Needs work » Needs review
FileSize
14.41 KB

I noticed the added file is missing from the last patch, re-rolled it.

@#23: I'm unable to reproduce that, can you? If so, please tell me how.

fago’s picture

FileSize
14.43 KB

Re-rolled patch.

klausi’s picture

Rerolled.

rafamd’s picture

Patch worked fine in click, click testing, maybe RTBC ?

Not exactly what I was looking for though.

We need a separate profile page (with view and edit sub-tabs) that displays as a tab along the user account page primary tabs. Something like this patch enables, but for the "separate page for editing profiles" (right now, this pages are located in the user menu).

When "Provide a separate page for editing profiles." is checked, we could have radios to select the page location: a) user menu and b) user account page (primary tab). Option b) would have url: example.com/user/user-name/profile-name/ for viewing and same/edit for editing.

Like this option ? Any clue on how to go for it ?

Thanks !

Edit: corrected example url

fago’s picture

Status: Needs review » Needs work
fago’s picture

Status: Needs work » Needs review
polskikrol’s picture

Tried to use this, however, would appear that the profile information has now disappeared from the user/[uid] page. Thinking for clarity, there should be an option on where to show the non-edit view of the profile data.

webkenny’s picture

Issue summary: View changes

Unclear if this is related, but I think it is. Before I open a new issue, I wanted to check. The project page says this:

By default the UI behaves similar to the deprecated core profile module, thus showing each profile type in each own tab below user//edit. Via the included "Profile pages" module profiles can be viewed and edited at their own page and get their own menu link, e.g. "My profile".

However in no case do I actually see tabs on the user edit screens. Even as User 1. Do the patches here aim to do this or is this project page out of date?

nithinkolekar’s picture

FileSize
78.12 KB

OP's concern was display of profile but this issue moving towards providing separate edit tabs which is also fine but why not display other user profile in separate tabs?
profile2 pages module description says
Adds separate pages for viewing and editing profiles.
but when user with having permission to "view user profiles" and to "view any < individual profile >".
When try to view other user's profile then all profiles are shown below each other instead of tabs.

junaidpv’s picture

I am not exactly sure how the patch is evolved to having more complex changes. As per original issue report, subtab under user profile "view" and "edit" tabs would be fine. Current version of this module already allow us to have subtabs for profile2 editing under user edit tab. We just need to turn off "Provide a separate page for editing profiles." in profile2 type edit page.

But it doe not provide sub tab for viewing profile2 info under user view page. Instead it displays profile2 data along with default user page content. We also encountered with same requirement now and I developed a fresh patch. That is attached here.

It will bring a new setting (checkbox) labeled "Provide a separate tab for viewing profiles." under profile2 type edit page (admin/structure/profiles/manage/). It will be visible only if we turn off separate page for that profile type by unchecking "Provide a separate page for editing profiles.". You will get separate sub tab for viewing profile2 profiles.

edvanleeuwen’s picture

The patch given by junaidpv does indeed give the proper viewing options. However, it does not seem to follow the permissions. It is only displayed when the option 'Administer profiles' is set (or as admin). I would like users to display their information and subsequently give set '[..]: View own profile'.

edvanleeuwen’s picture

I have tried to create a patch for the permissions, see 1836322. Unfortunately, this breaks the tabs patch.

AlfTheCat’s picture

Tried patch from #33 but nothing is happening. I'm not seeing a setting on when editing profiles to enable the tabs. And I don't see any tabs on user_view either.

junaidpv’s picture

@AlfTheCat, you need to uncheck "Provide a separate page for editing profiles." to make "Provide a separate tab for viewing profiles" checkbox to appear.

pyxio’s picture

the patch #33 does not work for me using dev version. i get notice

Notice: Trying to get property of non-object in profile2_profile2_access() (line 752 of /var/www/html/skypyx/sites/all/modules/contrib/profile2/profile2.module).

RickJ’s picture

This enhancement has been kicking about a long time, and I decided to have another look at it. Patch #33 has a definite bug as reported in #38 by @pyxio.

I've worked through and tidied it up, and added a few more enhancements to make it work more smoothly. In particular to get the page and profile titles to make sense and be consistent. It needs #2845725: Profile2 objects don't return useful label values for this to work properly - that's now been committed so I recommend installing the dev build if using this patch.

Please also clear cache after applying the patch.

If you display profiles in tabs, then there is a nice symmetry with the standard editing of profiles in equivalent tabs. Also, if you're viewing a profile tab and you click Edit, you go to editing the same profile (subject to permissions).

I'd like to include this in the next release, so feedback will be appreciated.

  • RickJ committed 9326df7 on 7.x-1.x
    Issue #894984 by fago, junaidpv, klausi, RickJ, nithinkolekar: display...
RickJ’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

RickJ’s picture

Assigned: RickJ » Unassigned