Skip to content

Commit

Permalink
core: add 'all' to search_result.
Browse files Browse the repository at this point in the history
This prevents some old code from not compiling because they use the now deprecated 'all'.
  • Loading branch information
mworrell committed Jul 21, 2022
1 parent 2d37faf commit 2303074
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/zotonic.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
search_name = 'query' :: atom(),
search_args = [] :: proplists:proplist(),
result = [] :: list(),
all = [] :: list(), % DEPRECATED is removed in 1.0
page = 1 :: pos_integer(),
pagelen = ?SEARCH_PAGELEN :: pos_integer() | undefined,
total = undefined :: non_neg_integer() | undefined,
Expand Down
6 changes: 4 additions & 2 deletions src/erlydtl/erlydtl_runtime.erl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ find_value(Key, #search_result{} = S, _Context) when is_atom(Key) ->
page -> S#search_result.page;
pages -> S#search_result.pages;
next -> S#search_result.next;
prev -> S#search_result.prev
prev -> S#search_result.prev;
all -> [] % Deprecated
end;
find_value(Key, #m_search_result{ result = Result } = S, _Context) when is_atom(Key) ->
case Key of
Expand All @@ -127,7 +128,8 @@ find_value(Key, #m_search_result{ result = Result } = S, _Context) when is_atom(
pages -> S#m_search_result.pages;
pagelen -> S#m_search_result.pagelen;
next -> S#m_search_result.next;
prev -> S#m_search_result.prev
prev -> S#m_search_result.prev;
all -> [] % Deprecated
end;

%% JSON-decoded proplist structure
Expand Down

0 comments on commit 2303074

Please sign in to comment.