Skip to content

Commit

Permalink
Fix introtext treatment in single article view
Browse files Browse the repository at this point in the history
$item->introtext should be assigned to $item->text when the
"show_noauth" option is set and user is guest. This is in order to have
the introtext correctly parsed by "onContentPrepare" event handlers.

After that  $item->introtext should be updated with the parsed
$item->text so that templates still relying on introtext will display
the correct output.
  • Loading branch information
smz committed Apr 17, 2016
1 parent 5207bac commit a3bfdf1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/com_content/views/article/view.html.php
Expand Up @@ -139,7 +139,11 @@ public function display($tpl = null)
return;
}

if ($item->params->get('show_intro', '1') == '1')
if (!$item->params->get('access-view') && $item->params->get('show_noauth', '0'))
{
$item->text = $item->introtext;
}
elseif ($item->params->get('show_intro', '1'))
{
$item->text = $item->introtext . ' ' . $item->fulltext;
}
Expand All @@ -160,6 +164,9 @@ public function display($tpl = null)
JPluginHelper::importPlugin('content');
$dispatcher->trigger('onContentPrepare', array ('com_content.article', &$item, &$item->params, $offset));

// Copy "text" to "introtext" for B/C (some templates might still use introtext...)
$item->introtext = $item->text;

$item->event = new stdClass;
$results = $dispatcher->trigger('onContentAfterTitle', array('com_content.article', &$item, &$item->params, $offset));
$item->event->afterDisplayTitle = trim(implode("\n", $results));
Expand Down

0 comments on commit a3bfdf1

Please sign in to comment.