?
avatar scorp13
scorp13
21 Sep 2017

Steps to reproduce the issue

Create multipage article with content like this:

some intro text
<hr id="system-readmore" />
some 1st page text
<hr class="system-pagebreak" />
some 2nd page text
<hr class="system-pagebreak" />
some 3rd page text

and try to access page 2 or 3

The main point is presence of <hr id="system-readmore" /> before <hr class="system-pagebreak" />

Actual result

404 error when trying to access a page other than the first.

System information (as much as possible)

Joomla 3.8

Additional comments

The reason in the code added by the commit
Code:

		// Check if the intro text needs to be processed as well
		if ($item->introtext && strpos($item->text, $item->introtext) !== 0)
		{
			// Save the old text of the article
			$text = $item->text;

			// Set the intro text as new text
			$item->text = $item->introtext;

			// Trigger the event with the introtext
			$dispatcher->trigger('onContentPrepare', array ('com_content.article', &$item, &$item->params, $offset));

			// Set the prepared intro text back
			$item->introtext = $item->text;

			// Restore the original text variable
			$item->text = $text;
		}

In the case of the article's structure I described (which is quite common), after

			// Set the intro text as new text
			$item->text = $item->introtext;

$item->text does not contain code <hr class="system-pagebreak" />

Next, in the onContentPrepare event handler of PageBreak plugin there is an error when trying to access the 2nd or more page:

// Simple performance check to determine whether bot should process further.
if (StringHelper::strpos($row->text, 'class="system-pagebreak') === false)
{
	if ($page > 0)
	{
		throw new Exception(JText::_('JERROR_PAGE_NOT_FOUND'), 404);
	}
	
	return true;
}
avatar scorp13 scorp13 - open - 21 Sep 2017
avatar joomla-cms-bot joomla-cms-bot - change - 21 Sep 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Sep 2017
avatar sandewt
sandewt - comment - 21 Sep 2017

It seems a known problem !!!
See the issues: #17830 and #18016 .


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18042.

avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Sep 2017
Category com_content
avatar franz-wohlkoenig franz-wohlkoenig - change - 21 Sep 2017
Status New Duplicate Report
Closed_Date 0000-00-00 00:00:00 2017-09-21 11:56:13
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 21 Sep 2017
Status Duplicate Report Closed
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 21 Sep 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 21 Sep 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 21 Sep 2017

closed as duplicate Report ##17830

Thanks for Hint @sandewt


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18042.

Add a Comment

Login with GitHub to post a comment