We have moved to Github. Please open tickets there.

Opened 21 months ago

Closed 20 months ago

Last modified 19 months ago

#3786 closed Defect (fixed)

Profile plugin mis-handles class replacement in views/default/profile/owner_block.php

Reported by: beck24 Owned by:
Priority: normal Milestone: Elgg 1.8.1b
Component: Core Version: 1.8 Beta
Severity: minor Keywords: Profile Plugin
Cc: brett@… Difficulty:

Description

owner_block.php declares two classes for the action links in the menu below the profile icon. These links are pulled from menu:user_hover.

if (elgg_is_logged_in() && $actions) {
  $profile_actions = '<ul class="elgg-menu profile-action-menu mvm">';
  foreach ($actions as $action) {
    $profile_actions .= '<li>' . $action->getContent(array('class' => 'elgg-button elgg-button-action')) . '</li>';
  }
  $profile_actions .= '</ul>';
}

If a dev has defined a class for one of these links the output is:

class="0"

which breaks both the default style and any functionality/style the dev intended.

This can be seen most readily in my Extendafriend 1.8.x plugin. Install it and remove the replacement /views/default/profile/owner_block.php

I believe the intent was to overwrite any classes, so the output no matter what should be:

class="elgg-button elgg-button-action"

Ideally I think it should combine the classes, so in my case the output would be:

class="elgg-button elgg-button-action elgg-lightbox"

That way any jquery functionality will be retained, and any style conflicts can be rectified with a css multiclass selector.

Change History (4)

comment:1 Changed 20 months ago by cash

  • Milestone changed from Needs Review to Elgg 1.8.1

comment:2 Changed 20 months ago by Cash Costello

  • Resolution set to fixed
  • Status changed from new to closed

Fixes #3786 menu code was corrupting link class if an additional class was passed through getContent()

Changeset: 4900853196f83a902a2acac11ae1bd4813bcb3fc

comment:3 Changed 20 months ago by brettp

  • Milestone changed from Elgg 1.8.1 to Elgg 1.8.1b

comment:4 Changed 19 months ago by Cash Costello

Fixes #3786 menu code was corrupting link class if an additional class was passed through getContent()

Changeset: 4900853196f83a902a2acac11ae1bd4813bcb3fc

Note: See TracTickets for help on using tickets.