Skip to content

Commit

Permalink
fix #99 Call processForm with empty values.
Browse files Browse the repository at this point in the history
From what I can see, widgets mostly do the right thing and return empty_marker if field.getName() is missing from the request. Perfect when programatically adding content through invokeFactory/api.content.create as the set values don't get modified.
  • Loading branch information
david-batranu committed Feb 9, 2018
1 parent cb26272 commit d953e0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plone/api/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ def create(
if IBaseObject.providedBy(content):
# Will finish Archetypes content item creation process,
# rename-after-creation and such
content.processForm(values=kwargs)
# Passing values as an empty dict so values set by invokeFactory
# don't get overridden.
content.processForm(values={})

if not id or (safe_id and id):
# Create a new id from title
Expand Down

0 comments on commit d953e0f

Please sign in to comment.