Skip to content

Commit 7ca0b45

Browse files
committed
Fix issue where paging/search threw an error for project specific blocks
1 parent faeeeab commit 7ca0b45

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
browsercms (4.0.0.beta)
4+
browsercms (4.0.0.beta.1)
55
actionpack-page_caching (~> 1.0)
66
ancestry (~> 2.0.0)
77
bootstrap-sass

app/helpers/cms/application_helper.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ def render_pagination(collection, content_type, options={})
173173
else
174174
render :partial => "pagination", :locals => {
175175
:collection => collection,
176-
:first_page_path => url_for({:page => 1}.merge(options)),
177-
:previous_page_path => url_for({:page => collection.previous_page ? collection.previous_page : 1}.merge(options)),
178-
:current_page_path => url_for(options),
179-
:next_page_path => url_for({:page => collection.next_page ? collection.next_page : collection.current_page}.merge(options)),
180-
:last_page_path => url_for({:page => collection.total_pages}.merge(options))
176+
:first_page_path => engine(content_type).url_for({:page => 1}.merge(options)),
177+
:previous_page_path => engine(content_type).url_for({:page => collection.previous_page ? collection.previous_page : 1}.merge(options)),
178+
:current_page_path => engine(content_type).url_for(options),
179+
:next_page_path => engine(content_type).url_for({:page => collection.next_page ? collection.next_page : collection.current_page}.merge(options)),
180+
:last_page_path => engine(content_type).url_for({:page => collection.total_pages}.merge(options))
181181
}
182182
end
183183
end

app/views/cms/application/_pagination.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<%= link_to "<< &nbsp;".html_safe, first_page_path, :id => "first_page_link" %>
1111
<%= link_to "< &nbsp;".html_safe, previous_page_path, :id => "previous_page_link" %>
1212
<% url = URI.parse(current_page_path) %>
13-
<%= form_tag url_for({}), :method => :get, :class => "current_page", style: 'display:inline' do %>
13+
<%= form_tag engine(content_type).url_for({}), :method => :get, :class => "current_page", style: 'display:inline' do %>
1414
<% url.query.to_s.split('&').each do |p|
1515
; k, v = p.split('=') %>
1616
<%= hidden_field_tag(k, CGI::unescape(v.to_s), :id => "pagination_hidden_#{k}") unless k == "page" %>

app/views/cms/content_block/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="padded row-fluid clearfix">
33
<h1 class="span3">Assets</h1>
44

5-
<%= form_for @search_filter, url: url_for({}), html: {class: 'form-search'}, method: :get do |f| %>
5+
<%= form_for @search_filter, url: engine(content_type).url_for({}), html: {class: 'form-search'}, method: :get do |f| %>
66
<%= f.text_field :term, class: "span6 search-query right", placeholder: "Search #{content_type.display_name_plural}" %>
77
<% end %>
88
</div>

lib/cms/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Allows the precise version of BrowserCMS to be determined programatically.
33
#
44
module Cms
5-
VERSION = "4.0.0.beta"
5+
VERSION = "4.0.0.beta.1"
66

77
# Return the current version of the CMS.
88
def self.version

0 commit comments

Comments
 (0)