Commit 77f3d701 authored by Ra Mänd's avatar Ra Mänd
Browse files

Fix unnecessary double quotes.

parent 89dcbb25
......@@ -88,10 +88,10 @@ function field_collection_field_render_revision($item, $context) {
$raw_values = $func($new_items, $field_context);
$values = array();
foreach ($raw_values as $raw_value) {
$values[] = is_array($raw_value) ? implode(", ", $raw_value) : $raw_value;
$values[] = is_array($raw_value) ? implode(', ', $raw_value) : $raw_value;
}
$result[] = check_plain($instance['label'] . ': ' . implode(", ", $values));
$result[] = check_plain($instance['label'] . ': ' . implode(', ', $values));
}
}
}
......
......@@ -448,7 +448,7 @@ class FieldCollectionItemEntity extends Entity {
public function save($skip_host_save = FALSE) {
// Make sure we have a host entity during creation.
if (!empty($this->is_new) && !(isset($this->hostEntityId) || isset($this->hostEntity) || isset($this->hostEntityRevisionId))) {
throw new Exception("Unable to create a field collection item without a given host entity.");
throw new Exception('Unable to create a field collection item without a given host entity.');
}
// Copy the values of translatable fields for a new field collection item.
......@@ -465,7 +465,7 @@ class FieldCollectionItemEntity extends Entity {
else {
$host_entity = $this->hostEntity();
if (!$host_entity) {
throw new Exception("Unable to save a field collection item without a valid reference to a host entity.");
throw new Exception('Unable to save a field collection item without a valid reference to a host entity.');
}
// If this is creating a new revision, also do so for the host entity.
if (!empty($this->revision) || !empty($this->is_new_revision)) {
......
......@@ -2217,19 +2217,19 @@ function field_collection_feeds_set_target($source, $entity, $target, $value, $m
}
// Check for a limit and force that limit.
if ($info["cardinality"] !== "-1") {
$value[$delta] = array_slice($value[$delta], 0, $info["cardinality"]);
if ($info['cardinality'] !== '-1') {
$value[$delta] = array_slice($value[$delta], 0, $info['cardinality']);
}
// HiJack the file callback so we can make it work.
if ($callback == "file_feeds_set_target") {
$callback = "field_collection_file_feeds_set_target";
if ($callback == 'file_feeds_set_target') {
$callback = 'field_collection_file_feeds_set_target';
}
// Allow altering with many parameters. Cannot use drupal_alter here.
$implements = module_implements("sub_target_pre_callback_parse");
$implements = module_implements('sub_target_pre_callback_parse');
foreach ($implements as $module_name) {
$hook = $module_name . "_" . "sub_target_pre_callback_parse";
$hook = $module_name . '_' . 'sub_target_pre_callback_parse';
$hook($target, $sub_target, $entity, $field, $field_collection_item, $value[$delta]);
}
......@@ -2286,7 +2286,7 @@ function field_collection_file_feeds_set_target($source, $entity, $target, $valu
return;
}
$entity_type = "field_collection_item";
$entity_type = 'field_collection_item';
$bundle = $entity->field_name;
// Determine file destination.
......
......@@ -344,15 +344,15 @@ class FieldCollectionBasicTestCase extends DrupalWebTestCase {
$this->drupalPost($path, $edit, t('Save'));
$this->assertText(t('The changes have been saved.'), 'Field collection saved.');
$this->assertText($edit['field_text[und][0][value]'], "Added field value is shown.");
$this->assertText($edit['field_text[und][0][value]'], 'Added field value is shown.');
$edit['field_text[und][0][value]'] = $this->randomName();
$this->drupalPost('field-collection/field-test-collection/1/edit', $edit, t('Save'));
$this->assertText(t('The changes have been saved.'), 'Field collection saved.');
$this->assertText($edit['field_text[und][0][value]'], "Field collection has been edited.");
$this->assertText($edit['field_text[und][0][value]'], 'Field collection has been edited.');
$this->drupalGet('field-collection/field-test-collection/1');
$this->assertText($edit['field_text[und][0][value]'], "Field collection can be viewed.");
$this->assertText($edit['field_text[und][0][value]'], 'Field collection can be viewed.');
// Add further 3 items, so we have reached 4 == maxium cardinality.
$this->drupalPost($path, $edit, t('Save'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment