Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not overriding set models. #207

Merged
merged 1 commit into from
Oct 21, 2015
Merged
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
2 changes: 1 addition & 1 deletion builder/xml_form_builder.module
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ function xml_form_builder_update_object(AbstractObject $object, array $associati
if ($label) {
$object->label = $label;
}
$object->models = array($association['content_model']);
$object->models = array_merge($object->models, array($association['content_model']));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't array_unique or the like be better to avoid duplicating content-models? Or is there a use case for having multiple of the same content-model in here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is handled at a lower level.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity and posterity, where is it handled?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$document = $document->document;
$run_transforms = !variable_get('xml_form_builder_use_default_dc_xslts', FALSE);
if (isset($association['self_transform']) && $association['self_transform'] != 'No Transform' && $run_transforms) {
Expand Down