Skip to content

Commit

Permalink
mod_admin_predicate/category: fix a problem with moving categories an…
Browse files Browse the repository at this point in the history
…d predicates.

(cherry picked from commit 2e17a5a)
  • Loading branch information
mworrell committed Apr 8, 2016
1 parent e3748e9 commit 7246338
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion modules/mod_admin_category/mod_admin_category.erl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ cat_move_and_delete(Ids, ToGroupId, Context) ->
ok.

in_categories(Ids, Context) when is_list(Ids) ->
z_db:q("select id from rsc where category_id in (SELECT(unnest($1::int[])))", [Ids], Context, 60000).
RscIds = z_db:q("select id from rsc where category_id in (SELECT(unnest($1::int[])))", [Ids], Context, 60000),
[ RscId || {RscId} <- RscIds ].

delete_all([], _N, _Total, _Context) ->
ok;
Expand Down
3 changes: 2 additions & 1 deletion modules/mod_admin_predicate/mod_admin_predicate.erl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ pred_move_and_delete(FromPredId, ToPredId, Context) ->
[FromPredId, ToPredId],
Context,
120000),
pred_move(Edges, ToPredId, 0, length(Edges), Context),
Edges1 = [ EdgeId || {EdgeId} <- Edges ],
pred_move(Edges1, ToPredId, 0, length(Edges), Context),
z_db:q("delete from edge where predicate_id = $1", [FromPredId], Context, 120000),
_ = m_rsc:delete(FromPredId, Context),
z_session_page:add_script(z_render:wire({unmask, []}, Context)).
Expand Down

0 comments on commit 7246338

Please sign in to comment.