anchor.diff:                  end,
   
                   RawProps = m_rsc:get_raw(Id, Context),
  -                case Id == insert_rsc orelse Changed orelse is_changed(RscId, RawProps, UpdatePropsN1) of
  +                case Id == insert_rsc orelse Changed orelse is_changed(RawProps, UpdatePropsN1) of
                       true ->
                           UpdatePropsPrePivoted = z_pivot_rsc:pivot_resource_update(UpdatePropsN1, RawProps),
                           {ok, _RowsModified} = z_db:update(rsc, RscId, UpdatePropsPrePivoted, Ctx),
  
positive.code:                                                         end,
                                                          SafeProps,
                                                          InsPropsN),
                                  {InsId, SafePropsN, InsPropsN, [], IsACat};
                              false ->
                                  throw({error, eacces})
                          end;
  
negative.code:                         % 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 ->
                                  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)", [InsertId], Ctx),
                                          true;
                                      false ->
                                          false
  