Skip to content

Commit

Permalink
Fix for templates using introtext when that's not supposed to happen
Browse files Browse the repository at this point in the history
  • Loading branch information
smz committed Apr 19, 2016
1 parent 976b4cf commit a491c82
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/com_content/views/article/view.html.php
Expand Up @@ -130,6 +130,8 @@ public function display($tpl = null)

$offset = $this->state->get('list.offset');

$full_fix = true;

// Check the view access to the article (the model has already computed the values).
if ($item->params->get('access-view') == false && ($item->params->get('show_noauth', '0') == '0'))
{
Expand All @@ -146,10 +148,12 @@ public function display($tpl = null)
elseif ($item->fulltext && $item->params->get('show_intro', '1'))
{
$item->text = $item->introtext . ' ' . $item->fulltext;
$full_fix = false;
}
elseif ($item->fulltext)
{
$item->text = $item->fulltext;
$full_fix = false;
}
else
{
Expand All @@ -165,7 +169,12 @@ public function display($tpl = null)
$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;
// but don't do that when introtex != text (there might be templates around using introtext when that's not supposed to happen)
// The introtext received by the above templates will not be processed by onContentPrepare: full B/C here!
if ($full_fix)
{
$item->introtext = $item->text;
}

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

0 comments on commit a491c82

Please sign in to comment.