handle cases where pageTextId is given but pageText is not in DB
This commit is contained in:
Sarjuuk
2015-07-18 15:16:35 +02:00
parent 3e7a34a2ea
commit 58a235e2e3
2 changed files with 27 additions and 9 deletions

View File

@@ -206,9 +206,16 @@ class ObjectPage extends GenericPage
{
while ($next)
{
$row = DB::World()->selectRow('SELECT *, text as Text_loc0 FROM page_text pt LEFT JOIN locales_page_text lpt ON pt.entry = lpt.entry WHERE pt.entry = ?d', $next);
$next = $row['next_page'];
$pageText[] = Util::parseHtmlText(Util::localizedString($row, 'Text'));
if ($row = DB::World()->selectRow('SELECT *, text as Text_loc0 FROM page_text pt LEFT JOIN locales_page_text lpt ON pt.entry = lpt.entry WHERE pt.entry = ?d', $next))
{
$next = $row['next_page'];
$pageText[] = Util::parseHtmlText(Util::localizedString($row, 'Text'));
}
else
{
Util::addNote(U_GROUP_STAFF, 'Referenced PageTextId #'.$next.' is not in DB');
break;
}
}
}