From 668be3046461834e334eb14fd4aaa759a8c002ca Mon Sep 17 00:00:00 2001 From: Marc Worrell Date: Fri, 23 Jan 2015 20:35:51 +0100 Subject: [PATCH] Fix problem with 0.11 (and later) transport which might return integers instead of lists for the query args. --- mod_slideshow.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mod_slideshow.erl b/mod_slideshow.erl index c102e96..16af447 100644 --- a/mod_slideshow.erl +++ b/mod_slideshow.erl @@ -82,8 +82,8 @@ observe_media_stillimage({media_stillimage, Id, _Props}, Context) -> %% @doc Handle a request for a slideshow popup observe_postback_notify(#postback_notify{message="slideshow"}, Context) -> - Ids = [ list_to_integer(Id) || Id <- z_context:get_q_all("id", Context) ], - Ids1 = [ Id || Id <- Ids, z_acl:rsc_visible(Id, Context) ], + Ids = [ z_convert:to_integer(Id) || Id <- z_context:get_q_all("id", Context) ], + Ids1 = [ Id || Id <- Ids, is_integer(Id), z_acl:rsc_visible(Id, Context) ], StartId = case z_context:get_q("start_id", Context) of [] -> undefined; QStartId -> list_to_integer(QStartId) @@ -97,8 +97,7 @@ observe_postback_notify(#postback_notify{message="slideshow"}, Context) -> {height, 600} ], Context); -observe_postback_notify(X, _Context) -> - ?DEBUG(X), +observe_postback_notify(_X, _Context) -> undefined. reorder_ids(undefined, Ids) ->