anchor.diff:                          % Check if the user is allowed to create the resource
                           case z_acl:is_allowed(insert, #acl_rsc{category=CategoryName}, Ctx) orelse not(AclCheck) of
                               true ->
  -                                case proplists:get_value(creator_id, Props) of
  -                                    self ->
  -                                        {ok, InsId} = z_db:insert(rsc, [{creator_id, undefined} | InsPropsN], Ctx),
  -                                        z_db:q("update rsc set creator_id = id where id = $1", [InsId], Ctx);
  -                                    CreatorId when is_integer(CreatorId) ->
  -                                        true = z_acl:is_admin(Ctx),
  -                                        {ok, InsId} = z_db:insert(rsc, [{creator_id, CreatorId} | InsPropsN], Ctx);
  -                                    undefined ->
  -                                        {ok, InsId} = z_db:insert(rsc, [{creator_id, z_acl:user(Ctx)} | InsPropsN], Ctx)
  -                                end,
  -                                
  -                                 % Insert a category record for categories. Categories are so low level that we want
  +                                InsertId = case proplists:get_value(creator_id, Props) of
  +                                            self ->
  +                                                {ok, InsId} = z_db:insert(rsc, [{creator_id, undefined} | InsPropsN], Ctx),
  +                                                z_db:q("update rsc set creator_id = id where id = $1", [InsId], Ctx),
  +                                                InsId;
  +                                            CreatorId when is_integer(CreatorId) ->
  +                                                true = z_acl:is_admin(Ctx),
  +                                                {ok, InsId} = z_db:insert(rsc, [{creator_id, CreatorId} | InsPropsN], Ctx),
  +                                                InsId;
  +                                            undefined ->
  +                                                {ok, InsId} = z_db:insert(rsc, [{creator_id, z_acl:user(Ctx)} | InsPropsN], Ctx),
  +                                                InsId
  +                                        end,
  +
  +                                % Insert a category record for categories. Categories are so low level that we want
                                   % to make sure that all categories always have a category record attached.
                                   InsertCatList = [ CategoryId | m_category:get_path(CategoryId, Ctx) ],
                                   IsACat = case lists:member(m_category:name_to_id_check(category, Ctx), InsertCatList) of
                                       true ->
  -                                        1 = z_db:q("insert into category (id, seq) values ($1, 1)", [InsId], Ctx),
  +                                        1 = z_db:q("insert into category (id, seq) values ($1, 1)", [InsertId], Ctx),
                                           true;
                                       false ->
                                           false
  
positive.code: 
  
  %% @doc Check if the update will change the data in the database
  %% @spec is_changed(int(), Current, Props) -> bool()
  is_changed(Id, Current, Props) ->
      is_prop_changed(Props, Current).
  
      is_prop_changed([], _Current) ->
  
negative.code:                 false -> AutogeneratedProps
              end,
              ok = preflight_check(Id, SafeProps, Context),
  
              %% This function will be executed in a transaction
              TransactionF = fun(Ctx) ->
                  {RscId, UpdateProps, BeforeProps, BeforeCatList, RenumberCats} = case Id of
  