Hi, just wanted to know if you will make a D7 version of this?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SeryiMysh’s picture

Please, port this module for D7?

alexbk66-’s picture

+1

Starminder’s picture

+1

laVera’s picture

+1

nothinghere’s picture

+1

Verscienta’s picture

+1

sw3b’s picture

++1

ebieymjunior’s picture

Any update yet?

crazyrohila’s picture

Title: Any plan for D7? » Patch For Drupal 7
Status: Active » Needs review

I created a patch for drupal7. Please Review patch.

--sanjay

crazyrohila’s picture

Sorry I forgot to attach patch file. :P

crazyrohila’s picture

Sorry I forgot to attach patch file. :P

crazyrohila’s picture

FileSize
2.22 KB

Oppss Sorry Sorry Sorry :(

crazyrohila’s picture

Title: Patch For Drupal 7 » Drupal 7 Patch
Version: 7.x-1.0 » 6.x-2.x-dev
Category: feature » task
FileSize
2.99 KB

The Patch creation way was wrong. So new patch is here.

gabor_h’s picture

The hook_user_view_alter() would be better than hook_user_view().

Example:

/**
 * Implementation of hook_user_view_alter().
 */
function alterprofilepage_user_view_alter(&$build) {
  if (isset($build['#account'])) {
    $account=$build['#account'];
    if (isset($build['summary']) && isset($build['summary']['member_for'])) {
      ..
    }
  }
  ..
}
jerdiggity’s picture

Assigned: Unassigned » jerdiggity
Status: Needs review » Patch (to be ported)
jerdiggity’s picture

Status: Patch (to be ported) » Fixed

Thanks crazyrohila for the patch... D7 version has been released.

gabor_h’s picture

Version: 6.x-2.x-dev » 7.x-1.2
Status: Fixed » Needs review

Dear jerdiggity,

Are you sure that you want to use hook_user_view instead of hook_user_view_alter?

hook_user_view:
"The module should format its custom additions for display and add them to the $account->content array."

hook_user_view_alter:
"The user was built; the module may modify the structured content.

This hook is called after the content has been assembled in a structured array and may be used for doing processing which requires that the complete user content structure has been built."

The hook_user_view was not meant to modify things, and there is no guarantee that the modules are called in the right order. What happens if the alterpageprofile is the very first module that is called in the hook_user_view?