Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/src/org/labkey/api/action/BaseApiAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ private FormAndErrors<FORM> defaultPopulateForm() throws Exception
saveRequestedApiVersion(getViewContext().getRequest(), null);

BindException errors = defaultBindParameters(getPropertyValues());
FORM form = (FORM)errors.getTarget();
FORM form = (errors.hasErrors() && getCommandClass().isRecord()) ? null : (FORM) errors.getTarget();

return new FormAndErrors<>(form, errors);
}
Expand Down Expand Up @@ -468,7 +468,8 @@ private FormAndErrors<FORM> populateJSONObjectForm() throws Exception
{
PropertyValues values = null == jsonObj ? new MutablePropertyValues() : new JsonPropertyValues(jsonObj);
BindException errors = defaultBindParameters(values);
return new FormAndErrors<>((FORM)errors.getTarget(), errors);
FORM form = errors.hasErrors() ? null : (FORM) errors.getTarget();
return new FormAndErrors<>(form, errors);
}

FORM form = getCommand();
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/action/FormViewAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public final ModelAndView handleRequest() throws Exception
try (Timing ignored = MiniProfiler.step("bind"))
{
errors = bindParameters(getPropertyValues());
form = (FORM)errors.getTarget();
form = (errors.hasErrors() && getCommandClass().isRecord()) ? null : (FORM) errors.getTarget();
}

return handleRequest(form, errors);
Expand Down
4 changes: 2 additions & 2 deletions api/src/org/labkey/api/data/RecordFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public RecordFactory(Class<K> clazz)
}
catch (ConversionException e)
{
throw new IllegalArgumentException("Failed to convert property value of type '" + value.getClass().getName() + "' to required type '" + p.getType() + "' for property '" + p.getName() + "'; " + e.getMessage());
throw new IllegalArgumentException("Failed to convert property value of type '" + value.getClass().getName() + "' to required type '" + p.getType().getName() + "' for property '" + p.getName() + "'; " + e.getMessage());
}
}).toArray();

Expand All @@ -95,7 +95,7 @@ public RecordFactory(Class<K> clazz)
throw e; // Unclear what the problem is, so just re-throw
if (missingPrimitiveParameters.size() == 1)
throw new IllegalArgumentException("Primitive parameter \"" + missingPrimitiveParameters.getFirst() + "\" is required");
throw new IllegalArgumentException("One or more primitive parameters are missing. Primitive parameters include: " + missingPrimitiveParameters);
throw new IllegalArgumentException("Primitive parameters are missing: " + missingPrimitiveParameters);
}
catch (InstantiationException | IllegalAccessException | InvocationTargetException e)
{
Expand Down
2 changes: 1 addition & 1 deletion api/src/org/labkey/api/security/roles/EditorRole.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class EditorRole extends EditorWithoutDeleteRole
{
protected static Collection<Class<? extends Permission>> PERMISSIONS = Stream.concat(
static final Collection<Class<? extends Permission>> PERMISSIONS = Stream.concat(
EditorWithoutDeleteRole.PERMISSIONS.stream(),
Stream.of(
DeletePermission.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public class EditorWithoutDeleteRole extends AbstractRole
{
protected static Collection<Class<? extends Permission>> PERMISSIONS = Stream.concat(
static final Collection<Class<? extends Permission>> PERMISSIONS = Stream.concat(
AuthorRole.PERMISSIONS.stream(),
Stream.of(
EditSharedReportPermission.class,
Expand Down