fixed endless loop in entry overview; fixed PHP warning

This commit is contained in:
azett 2022-10-11 13:43:19 +02:00
parent 227b4d30d8
commit 80abe0a55d
3 changed files with 31 additions and 64 deletions

View File

@ -7,14 +7,11 @@
<div id="admin-drafts">
<p>Your drafts:</p>
<ul>
{draft}
{foreach from=$draft_list key=draftid item=draft}
<li>
<a href="admin.php?p=entry&amp;entry={$id}&amp;action=write">{$subject|truncate:70}</a>
<a href="admin.php?p=entry&amp;entry={$draftid}&amp;action=write">{$draft|truncate:50}</a>
</li>
{/draft}
{/foreach}
</ul>
</div>

View File

@ -168,36 +168,6 @@ function smarty_block_draftlist($params, $content, &$smarty, &$repeat) {
}
}
function smarty_block_draft($params, $content, &$smarty, &$repeat) {
$smarty->assign(array(
'subject' => '',
'content' => '',
'date' => '',
'author' => '',
'version' => '',
'id' => ''
));
$arr = $smarty->getTemplateVars('draft_list');
$id = $subject = null;
if ($arr) {
$firstElement = utils_array_kshift($arr);
$id = array_keys($firstElement);
$id = $id [0];
$subject = $firstElement [$id];
}
if ($id) {
$smarty->assign('subject', $subject);
$smarty->assign('id', $id);
}
$repeat = (bool) $id;
return $content;
}
$smarty->registerPlugin('block', 'draft_block', 'smarty_block_draftlist');
$smarty->registerPlugin('block', 'draft', 'smarty_block_draft');
?>

View File

@ -543,7 +543,7 @@ class FPDB_Query {
if ($this->params->page) {
// if ($this->_getOffsetId(0, ($this->params->start + $this->params->count)))
if ($this->walker->valid)
if ($this->walker && $this->walker->valid)
return array(
$GLOBALS ['lang'] ['main'] ['nextpage'],
$this->params->page + 1