From a911c05edfdfa514615df7319530530c5ca0a566 Mon Sep 17 00:00:00 2001 From: Adrian Yee Date: Tue, 18 Feb 2014 19:31:59 -0800 Subject: [PATCH 1/4] Add desk/workspace paging fixes changelog entry. --- lib/Bric/Changes.pod | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Bric/Changes.pod b/lib/Bric/Changes.pod index 727e5be2f..de1d5efd4 100644 --- a/lib/Bric/Changes.pod +++ b/lib/Bric/Changes.pod @@ -186,6 +186,11 @@ Fix for the possibility that a FTP server would return a list, not a text messag reported in L. [Phillip Smith] +=item * + +Fix fatal error when using paging on desk/workspace and correctly highlight the +current page. [Adrian Yee] + =back =head1 Version 2.0.1 () From b0d3f7dac8ab11156d8d8376ea8116271583eaf3 Mon Sep 17 00:00:00 2001 From: Adrian Yee Date: Tue, 18 Feb 2014 19:32:09 -0800 Subject: [PATCH 2/4] Fix desk/workspace current page highlighting with paging. --- comp/widgets/desk/desk_bottom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comp/widgets/desk/desk_bottom.html b/comp/widgets/desk/desk_bottom.html index 2ec2b83d1..6abf33d4a 100644 --- a/comp/widgets/desk/desk_bottom.html +++ b/comp/widgets/desk/desk_bottom.html @@ -5,7 +5,7 @@
<% $prev_link %> % foreach my $page (0 .. $num_pages) { -% if ($page == $offset) { +% if ($page * $limit == $offset) { <% $page + 1 %>  % } else { % my $off = $page * $limit; From a181418414f2f9e610cb9dc6ea8fcec8a2d1ee94 Mon Sep 17 00:00:00 2001 From: Adrian Yee Date: Tue, 18 Feb 2014 19:32:15 -0800 Subject: [PATCH 3/4] Fix desk/workspace paging fatal error. Paging was broken and using it would cause a fatal error: 'Modification of non-creatable array value attempted, subscript -240' --- comp/widgets/desk/desk.mc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comp/widgets/desk/desk.mc b/comp/widgets/desk/desk.mc index 4c8779d5d..aaef34d95 100644 --- a/comp/widgets/desk/desk.mc +++ b/comp/widgets/desk/desk.mc @@ -243,7 +243,7 @@ if ($class eq 'template') { $obj_offset -= $num_media if $offset; } -if (defined $objs && @$objs > $obj_offset) { +if (defined $objs && @$objs && @$objs > $obj_offset) { $m->comp( '/widgets/desk/desk_top.html', class => $class, From dbae1c505400a03f3600904987d10dcdd3e57f21 Mon Sep 17 00:00:00 2001 From: Adrian Yee Date: Wed, 26 Feb 2014 12:47:52 -0800 Subject: [PATCH 4/4] Fix related link edit pagination. $id arg wasn't being preserved on pagination causing a fatal error. Modified the template to just do the same thing that edit_related_media.html does. --- .../profile/story/container/edit_related_story.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/comp/workflow/profile/story/container/edit_related_story.html b/comp/workflow/profile/story/container/edit_related_story.html index 7d5dc8764..07ee7a81a 100644 --- a/comp/workflow/profile/story/container/edit_related_story.html +++ b/comp/workflow/profile/story/container/edit_related_story.html @@ -22,12 +22,18 @@ <%args> -$id +$id => undef <%init>; my $crumb = get_state_data('container_prof', 'crumb') || ''; $crumb .= ' |' if $crumb; +if ($id) { + set_state_data('container_prof', relate_to_id => $id); +} else { + $id = get_state_data('container_prof', 'relate_to_id'); +} +die "no value sent for required parameter 'id'" unless $id; <%doc>