wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r19999: LJSUP-9738: There is pagination button e...

Committer: gprochaev
LJSUP-9738: There is pagination button even if no records in the journal on editjournal page

U   trunk/htdocs/editjournal.bml
Modified: trunk/htdocs/editjournal.bml
===================================================================
--- trunk/htdocs/editjournal.bml	2011-09-08 08:45:12 UTC (rev 19998)
+++ trunk/htdocs/editjournal.bml	2011-09-08 08:46:13 UTC (rev 19999)
@@ -639,6 +639,7 @@
         my $prev_page_id = ($start_from > 0) ? ($start_from + $items_per_page) : 0;
         my $ymd = join "/", ($year, $month, $day);
         my %ymd_req = ($year && $month && $day && $show ne 'recent') ? ( ymd => $ymd ) : ();
+        my @post_ids = sort { $b <=> $a } ($usejournal_u ? $usejournal_u->get_post_ids : $remote->get_post_ids);
         while ($usejournal_u && ($LJ::MAX_SCROLLBACK_LASTN = 50000,
             my @recent = LJ::get_recent_items({
                 itemshow  => $items_per_page,
@@ -683,7 +684,7 @@
             }
         }
 
-        $ret .= $entry_chooser->(\@recent_entries, prev => $prev_page_id, 'next' => $start_from);
+        $ret .= $entry_chooser->(\@recent_entries, prev => $post_ids[0] >= $prev_page_id ? $prev_page_id : 0, 'next' => @recent_entries >= $items_per_page ? $start_from : 0);
 
         my $ad = LJ::get_ads({ location => 'bml.editjournal', ljadwrapper => 1 });
         if ($ad) {

Tags: bml, livejournal, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments