Skip to content

Commit

Permalink
Fix onContentPrepare event in contact view to trigger on correct text (
Browse files Browse the repository at this point in the history
…#10541)

Issue:
the onContentPrepare event triggering on the view has no effect

Instructions:
1. Edit a contact
2. Go to "Miscellaneous Information" TAB
3. Add plugin text of some content plugin that does not limit itself into some specific component / view
4. View the contact in frontend , the plugin text is replaced ...
  • Loading branch information
ggppdk authored and roland-d committed May 23, 2016
1 parent de084ce commit 0a98dbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/com_contact/views/contact/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function display($tpl = null)
$offset = $state->get('list.offset');

// Fix for where some plugins require a text attribute
!empty($item->description)? $item->text = $item->description : $item->text = null;
!empty($item->misc)? $item->text = $item->misc : $item->text = null;
$dispatcher->trigger('onContentPrepare', array ('com_contact.contact', &$item, &$this->params, $offset));

// Store the events for later
Expand All @@ -254,7 +254,7 @@ public function display($tpl = null)

if ($item->text)
{
$item->description = $item->text;
$item->misc = $item->text;
}

// Escape strings for HTML output
Expand Down

0 comments on commit 0a98dbe

Please sign in to comment.