diff -u b/migrate/fields/ParagraphsMigrateParagraphsFieldHandler.inc b/migrate/fields/ParagraphsMigrateParagraphsFieldHandler.inc --- b/migrate/fields/ParagraphsMigrateParagraphsFieldHandler.inc +++ b/migrate/fields/ParagraphsMigrateParagraphsFieldHandler.inc @@ -1,19 +1,18 @@ &$item) { - if ($current_entity = paragraphs_field_get_entity($item)) { - $current_entity = replicate_clone_entity('paragraphs_item', $current_entity); - $current_entity->setHostEntity($entity_type, $source_entity, $langcode, FALSE); - $current_entity->save(TRUE); - $news_items[] = array( - 'value' => $current_entity->item_id, - 'revision_id' => $current_entity->revision_id, - ); - } - } - $items = $news_items; + if (empty($id)) { + $news_items = array(); + foreach ($items as $key => &$item) { + if ($current_entity = paragraphs_field_get_entity($item)) { + $current_entity = replicate_clone_entity('paragraphs_item', $current_entity); + $current_entity->setHostEntity($entity_type, $source_entity, $langcode, FALSE); + $current_entity->save(TRUE); + $news_items[] = array( + 'value' => $current_entity->item_id, + 'revision_id' => $current_entity->revision_id, + ); + } } -} \ No newline at end of file + $items = $news_items; + } +} diff -u b/paragraphs.field_widget.inc b/paragraphs.field_widget.inc --- b/paragraphs.field_widget.inc +++ b/paragraphs.field_widget.inc @@ -37,10 +37,11 @@ case 'paragraphs_hidden': return $element; - break; + break; case 'paragraphs_embed': return paragraphs_field_multiple_value_form($field, $instance, $langcode, $items, $form, $form_state, $delta, $element); - break; + + break; } } @@ -50,7 +51,7 @@ * Handles generic features for multiple fields: * - number of widgets * - AHAH-'add more' button - * - drag-n-drop value reordering + * - drag-n-drop value reordering. */ function paragraphs_field_multiple_value_form($field, $instance, $langcode, $items, &$form, &$form_state, $delta, $original_element) { $field_name = $field['field_name']; @@ -186,7 +187,6 @@ 'weight' => $weight, ); - /* @var $entity_shell ParagraphsItemEntity */ $entity_shell = entity_create('paragraphs_item', array('bundle' => $machine_name, 'field_name' => $field_name)); $entity_shell->setHostEntity($original_element['#entity_type'], $original_element['#entity'], $langcode, FALSE); @@ -196,7 +196,7 @@ $removed_a_bundle = TRUE; } elseif (isset($instance['settings']['bundle_weights'][$machine_name])) { - $select_bundles[$machine_name]['weight'] = $instance['settings']['bundle_weights'][$machine_name]; + $select_bundles[$machine_name]['weight'] = $instance['settings']['bundle_weights'][$machine_name]; } $weight++; } @@ -542,7 +542,6 @@ ); } - if (isset($paragraph_item)) { $element['actions']['remove_button'] = array( '#delta' => $delta, @@ -561,7 +560,6 @@ ); } - if (isset($element['actions']['edit_button']) && !$element['actions']['edit_button']['#access'] && isset($element['actions']['remove_button']) && !$element['actions']['remove_button']['#access']) { $element['access_info'] = array( @@ -642,7 +640,6 @@ return $element; } - /** * FAPI #after_build of an individual paragraph element to delay the validation of #required. */ @@ -752,6 +749,7 @@ /** * Submit function to add another paragraph. + * * @param $form * @param $form_state */ @@ -807,7 +805,6 @@ return $element; } - /** * Submit callback to remove an item from the field UI multiple wrapper. * @@ -848,7 +845,7 @@ // the user had selected. $input = drupal_array_get_nested_value($form_state['input'], $address); // Sort by weight, - // but first remove garbage values to ensure proper '_weight' sorting + // but first remove garbage values to ensure proper '_weight' sorting. unset($input['add_more']); uasort($input, '_field_sort_items_helper'); @@ -906,7 +903,7 @@ // the user had selected. $input = drupal_array_get_nested_value($form_state['input'], $address); // Sort by weight, - // but first remove garbage values to ensure proper '_weight' sorting + // but first remove garbage values to ensure proper '_weight' sorting. unset($input['add_more']); uasort($input, '_field_sort_items_helper'); @@ -965,7 +962,7 @@ // the user had selected. $input = drupal_array_get_nested_value($form_state['input'], $address); // Sort by weight, - // but first remove garbage values to ensure proper '_weight' sorting + // but first remove garbage values to ensure proper '_weight' sorting. unset($input['add_more']); uasort($input, '_field_sort_items_helper'); @@ -1024,7 +1021,7 @@ // the user had selected. $input = drupal_array_get_nested_value($form_state['input'], $address); // Sort by weight, - // but first remove garbage values to ensure proper '_weight' sorting + // but first remove garbage values to ensure proper '_weight' sorting. unset($input['add_more']); uasort($input, '_field_sort_items_helper'); @@ -1044,6 +1041,7 @@ /** * Submit function to restore a paragraph that was deleted. + * * @param $form * @param $form_state */ @@ -1062,12 +1060,10 @@ $field_state = field_form_get_state($parents, $field_name, $langcode, $form_state); - if (isset($field_state['entity'][$delta])) { $field_state['entity'][$delta]->removed = 0; } - // Fix the weights. Field UI lets the weights be in a range of // (-1 * item_count) to (item_count). This means that when we remove one, // the range shrinks; weights outside of that range then get set to @@ -1079,7 +1075,7 @@ // the user had selected. $input = drupal_array_get_nested_value($form_state['input'], $address); // Sort by weight, - // but first remove garbage values to ensure proper '_weight' sorting + // but first remove garbage values to ensure proper '_weight' sorting. unset($input['add_more']); uasort($input, '_field_sort_items_helper'); diff -u b/paragraphs.migrate.inc b/paragraphs.migrate.inc --- b/paragraphs.migrate.inc +++ b/paragraphs.migrate.inc @@ -1,4 +1,5 @@ t('items.'), '#default_value' => (isset($settings['default_edit_mode_override']) && !empty($settings['default_edit_mode_override'])) ? $settings['default_edit_mode_override'] : PARAGRAPHS_DEFAULT_EDIT_MODE_OVERRIDE, '#states' => array( - // Hide the settings when the the default edit mode is set to "Open." + // Hide the settings when the the default edit mode is set to "Open.". 'invisible' => array( - ':input[name="instance[settings][default_edit_mode]"]' => array('value' => 'open'), + ':input[name="instance[settings][default_edit_mode]"]' => array('value' => 'open'), ), ), - '#size' => 2, - '#maxlength' => 2, + '#size' => 2, + '#maxlength' => 2, // Specify width, since size property isn't supported on number fields. - '#attributes' => $elements_exists ? array('style' => 'width:3em') : array(), - '#min' => 1, - '#max' => 99, + '#attributes' => $elements_exists ? array('style' => 'width:3em') : array(), + '#min' => 1, + '#max' => 99, ); if (!$elements_exists) { $element['default_edit_mode_override']['#element_validate'] = array('element_validate_integer_positive'); @@ -601,7 +606,7 @@ if (!count($bundles)) { $element['allowed_bundles_explain'] = array( '#type' => 'markup', - '#markup' => t('You did not add any paragraph bundles yet, click !here to add one.', array('!here' => l(t('here'), 'admin/structure/paragraphs/add', array('query' => drupal_get_destination())))) + '#markup' => t('You did not add any paragraph bundles yet, click !here to add one.', array('!here' => l(t('here'), 'admin/structure/paragraphs/add', array('query' => drupal_get_destination())))), ); } @@ -627,6 +632,9 @@ return $element; } +/** + * + */ function theme_paragraphs_bundle_settings_form($variables) { $form = $variables['form']; @@ -713,7 +721,6 @@ return $form; } - /** * Implements hook_field_presave(). * @@ -764,7 +771,6 @@ } } - /** * Implements hook_field_update(). * @@ -929,7 +935,7 @@ } /** - * Load a specific bundle or a list of bundles + * Load a specific bundle or a list of bundles. * * @param string|null $name * The machine name or list of bundles to load when null. @@ -937,14 +943,14 @@ * @param bool $rebuild * Whether to use cache or not. * - * @return array|stdClass|bool + * @return array|object|bool * The bundle, a list of bundles, or FALSE when not found. */ function paragraphs_bundle_load($name = NULL, $rebuild = FALSE) { $cid = 'paragraphs_bundles'; $bundles = array(); - // Load bundles from static or from Drupal cache + // Load bundles from static or from Drupal cache. $_bundles = &drupal_static($cid); if (isset($_bundles) && !$rebuild) { $bundles = $_bundles; @@ -990,7 +996,7 @@ /** * Function to create or update an paragraphs bundle. * - * @param stdClass $bundle + * @param object $bundle * The object of the bundle to create/update. * * @return int @@ -1228,7 +1234,6 @@ } } - $output = '
'; if (count($items)) { $output .= $field_content; @@ -1342,7 +1347,7 @@ // paragraphs break completely. // A proper implementation of entity_translation has still to be discussed. // @see https://drupal.org/node/2152931 - list( , , $bundle) = entity_extract_ids($entity_type, $entity); + list(, , $bundle) = entity_extract_ids($entity_type, $entity); foreach (field_info_instances($entity_type, $bundle) as $instance) { @@ -1359,7 +1364,7 @@ if (!empty($element['#process'])) { $key = array_search('entity_translation_prepare_element', $element['#process']); - if ($key !== FALSE) { + if ($key !== FALSE) { unset($element['#process'][$key]); } } @@ -1375,17 +1380,17 @@ */ function paragraphs_field_prepare_translation($entity_type, $entity, $field, $instance, $langcode, &$items, $source_entity, $source_langcode) { if (!module_exists("paragraphs_i18n")) { - list($id, , ) = entity_extract_ids($entity_type, $entity); + list($id, ,) = entity_extract_ids($entity_type, $entity); - // field_attach_prepare_translation() copied the entity ids from the source, - // as we need a new entity for a new translation, we cannot reuse that. - // @todo clone existing paragraphs to new translation - if (empty($id)) { - $items = array(); - } + // field_attach_prepare_translation() copied the entity ids from the source, + // as we need a new entity for a new translation, we cannot reuse that. + // @todo clone existing paragraphs to new translation + if (empty($id)) { + $items = array(); + } } else { - paragraphs_i18n_field_prepare_translation($entity_type, $entity, $field, $instance, $langcode, $items, $source_entity, $source_langcode); + paragraphs_i18n_field_prepare_translation($entity_type, $entity, $field, $instance, $langcode, $items, $source_entity, $source_langcode); } } @@ -1464 +1469 @@ -} \ No newline at end of file +} only in patch2: unchanged: --- a/ParagraphsItemEntity.inc +++ b/ParagraphsItemEntity.inc @@ -1,6 +1,6 @@ field_name)) { - // Ok, we have the field name property, we can proceed and check the field's type + // Ok, we have the field name property, we can proceed and + // check the field's type. $field_info = $this->fieldInfo(); // Check if we have field info, if not, our field is deleted. @@ -162,7 +163,7 @@ class ParagraphsItemEntity extends Entity { return ''; } - // Should only happen when there is something wrong + // Should only happen when there is something wrong. return t('Unconnected paragraphs item'); } @@ -194,6 +195,7 @@ class ParagraphsItemEntity extends Entity { * @param $create_link * (optional) Whether a field-item linking the host entity to the field * collection item should be created. + * * @throws Exception * When you try to set the host when the item has already been created. */ @@ -272,8 +274,7 @@ class ParagraphsItemEntity extends Entity { } /** - * Returns the bundle of the host entity, which embeds this paragraphs - * item. + * Returns the bundle of the host entity, which embeds this paragraphs item. */ public function hostEntityBundle() { return $this->hostEntityBundle; @@ -335,8 +336,7 @@ class ParagraphsItemEntity extends Entity { } /** - * Determines the $delta of the reference pointing to this paragraph - * item. + * Determines the $delta of the reference pointing to this paragraph item. */ public function delta() { if (($entity = $this->hostEntity()) && isset($entity->{$this->field_name})) { @@ -367,7 +367,7 @@ class ParagraphsItemEntity extends Entity { /** * Determines whether this paragraphs item revision is in use. * - * paragraphs items may be contained in from non-default host entity + * Paragraphs items may be contained in from non-default host entity * revisions. If the paragraphs item does not appear in the default * host entity revision, the item is actually not used by default and so * marked as 'archived'. @@ -424,7 +424,7 @@ class ParagraphsItemEntity extends Entity { $host_entity->{$this->field_name}[$this->langcode][$delta] = array('entity' => $this); } else { - $host_entity->{$this->field_name}[$this->langcode][] = array('entity' => $this); + $host_entity->{$this->field_name}[$this->langcode][] = array('entity' => $this); } return entity_save($this->hostEntityType, $host_entity); } @@ -448,7 +448,6 @@ class ParagraphsItemEntity extends Entity { * a paragraphs item on the default revision of the host should not * delete the collection item from archived revisions too. Instead, we delete * the current default revision and archive the paragraph. - * */ public function deleteRevision($skip_host_update = FALSE) { if (!$this->revision_id) { @@ -507,6 +506,7 @@ class ParagraphsItemEntity extends Entity { /** * Ensure file fields on the entity have their URIs loaded for previews. + * * Copied from #1447338-7, thanks! */ public function view($view_mode = 'full', $langcode = NULL, $page = NULL) { @@ -564,4 +564,5 @@ class ParagraphsItemEntity extends Entity { public function __wakeup() { $this->setUp(); } + } only in patch2: unchanged: --- a/ParagraphsItemMetadataController.inc +++ b/ParagraphsItemMetadataController.inc @@ -1,19 +1,21 @@ field_name; } - static public function getKeySchema() { + /** + * + */ + public static function getKeySchema() { return array( 'item_id' => array( 'type' => 'int', @@ -47,23 +53,23 @@ class MigrateDestinationParagraphsItem extends MigrateDestinationEntity { * Return an options array for node destinations. * * @param string $language - * Default language for nodes created via this destination class. + * Default language for nodes created via this destination class. * @param string $text_format - * Default text format for nodes created via this destination class. + * Default text format for nodes created via this destination class. */ - static public function options($language, $text_format) { + public static function options($language, $text_format) { return compact('language', 'text_format'); } - /** * Returns a list of fields available to be mapped for the node type (bundle) * * @param Migration $migration - * Optionally, the migration containing this destination. + * Optionally, the migration containing this destination. + * * @return array - * Keys: machine names of the fields (to be passed to addFieldMapping) - * Values: Human-friendly descriptions of the fields. + * Keys: machine names of the fields (to be passed to addFieldMapping) + * Values: Human-friendly descriptions of the fields. */ public function fields($migration = NULL) { $fields = array(); @@ -81,7 +87,7 @@ class MigrateDestinationParagraphsItem extends MigrateDestinationEntity { * Delete a batch of nodes at once. * * @param $nids - * Array of node IDs to be deleted. + * Array of node IDs to be deleted. */ public function bulkRollback(array $item_ids) { migrate_instrument_start('paragraphs_item_delete_multiple'); @@ -95,12 +101,13 @@ class MigrateDestinationParagraphsItem extends MigrateDestinationEntity { * Import a single node. * * @param $node - * Node object to build. Prefilled with any fields mapped in the Migration. + * Node object to build. Prefilled with any fields mapped in the Migration. * @param $row - * Raw source data object - passed through to prepare/complete handlers. + * Raw source data object - passed through to prepare/complete handlers. + * * @return array - * Array of key fields (nid only in this case) of the node that was saved if - * successful. FALSE on failure. + * Array of key fields (nid only in this case) of the node that was saved if + * successful. FALSE on failure. */ public function import(stdClass $paragraphs_item, stdClass $row) { $migration = Migration::currentMigration(); @@ -148,7 +155,7 @@ class MigrateDestinationParagraphsItem extends MigrateDestinationEntity { array('!item_id' => $paragraphs_item->item_id))); } } - // Provide defaults for SOURCE d + // Provide defaults for SOURCE d. else { // Set some default properties. $defaults = array( @@ -177,7 +184,6 @@ class MigrateDestinationParagraphsItem extends MigrateDestinationEntity { $entity = entity_create('paragraphs_item', (array) $paragraphs_item); } - if (isset($entity->item_id) && $entity->item_id) { $updating = TRUE; } @@ -204,4 +210,5 @@ class MigrateDestinationParagraphsItem extends MigrateDestinationEntity { } return $return; } + } only in patch2: unchanged: --- a/paragraphs.admin.inc +++ b/paragraphs.admin.inc @@ -1,4 +1,5 @@ t('Operations'), 'colspan' => $field_ui ? '4' : '2') + array('data' => t('Operations'), 'colspan' => $field_ui ? '4' : '2'), ); $rows = array(); foreach ($bundles as $bundle) { @@ -32,29 +33,29 @@ function paragraphs_admin_bundle_overview() { '@bundle_name' => $bundle->name, '@bundle_machine_name' => $bundle->bundle, )), - ) + ), ); if ($field_ui) { // Manage fields. $row[] = array( - 'data' => l(t('manage fields'), 'admin/structure/paragraphs/' . $type_url_str . '/fields') + 'data' => l(t('manage fields'), 'admin/structure/paragraphs/' . $type_url_str . '/fields'), ); // Display fields. $row[] = array( - 'data' => l(t('manage display'), 'admin/structure/paragraphs/' . $type_url_str . '/display') + 'data' => l(t('manage display'), 'admin/structure/paragraphs/' . $type_url_str . '/display'), ); } // Manage bundle. $row[] = array( - 'data' => l(t('edit bundle'), 'admin/structure/paragraphs/' . $type_url_str . '/edit') + 'data' => l(t('edit bundle'), 'admin/structure/paragraphs/' . $type_url_str . '/edit'), ); // Delete bundle. $row[] = array( - 'data' => l(t('delete bundle'), 'admin/structure/paragraphs/' . $type_url_str . '/delete') + 'data' => l(t('delete bundle'), 'admin/structure/paragraphs/' . $type_url_str . '/delete'), ); $rows[$bundle->bundle] = $row; @@ -80,7 +81,7 @@ function paragraphs_admin_bundle_overview() { function paragraphs_admin_bundle_form($form, &$form_state, $bundle = NULL) { if (!isset($bundle) && !$bundle) { - // This is a new bundle + // This is a new bundle. $bundle = new stdClass(); $bundle->name = ''; $bundle->bundle = ''; @@ -185,7 +186,6 @@ function paragraphs_admin_bundle_form_submit($form, &$form_state) { unset($variables['form_token'], $variables['op'], $variables['submit'], $variables['delete'], $variables['reset'], $variables['form_id'], $variables['form_build_id']); - $status = paragraphs_bundle_save($bundle); $t_args = array('%name' => $bundle->name); @@ -203,7 +203,7 @@ function paragraphs_admin_bundle_form_submit($form, &$form_state) { } /** - * Menu callback; delete a single paragraph bundle + * Menu callback; delete a single paragraph bundle. * * @ingroup forms */ @@ -246,4 +246,4 @@ function paragraphs_admin_bundle_delete_form_submit($form, &$form_state) { */ function paragraphs_bundle_title_callback($bundle) { return t('Edit Paragraph Bundle !name', array('!name' => $bundle->name)); -} \ No newline at end of file +} only in patch2: unchanged: --- a/paragraphs.ajax.inc +++ b/paragraphs.ajax.inc @@ -33,7 +33,7 @@ function paragraphs_edit_js() { $return = array( '#type' => 'ajax', '#commands' => array( - ajax_command_replace('#' . $element['#id'], drupal_render($element)) + ajax_command_replace('#' . $element['#id'], drupal_render($element)), ), ); @@ -75,7 +75,7 @@ function paragraphs_collapse_js() { $return = array( '#type' => 'ajax', '#commands' => array( - ajax_command_replace('#' . $element['#id'], drupal_render($element)) + ajax_command_replace('#' . $element['#id'], drupal_render($element)), ), ); @@ -117,7 +117,7 @@ function paragraphs_remove_js() { $return = array( '#type' => 'ajax', '#commands' => array( - ajax_command_replace('#' . $element['#id'], drupal_render($element)) + ajax_command_replace('#' . $element['#id'], drupal_render($element)), ), ); @@ -131,7 +131,6 @@ function paragraphs_remove_js() { return $return; } - /** * Page callback to handle AJAX for removing a paragraphs item. * @@ -160,7 +159,7 @@ function paragraphs_deleteconfirm_js() { $return = array( '#type' => 'ajax', '#commands' => array( - ajax_command_replace('#' . $element['#id'], drupal_render($element)) + ajax_command_replace('#' . $element['#id'], drupal_render($element)), ), ); @@ -202,7 +201,7 @@ function paragraphs_restore_js() { $return = array( '#type' => 'ajax', '#commands' => array( - ajax_command_replace('#' . $element['#id'], drupal_render($element)) + ajax_command_replace('#' . $element['#id'], drupal_render($element)), ), ); only in patch2: unchanged: --- a/paragraphs.features.inc +++ b/paragraphs.features.inc @@ -78,7 +78,7 @@ function paragraphs_features_export_render($module, $data, $export = NULL) { * Implements hook_features_revert(). * * @param $module - * name of module to revert content for + * name of module to revert content for */ function paragraphs_features_revert($module = NULL) { if ($default_types = features_get_default('paragraphs', $module)) { only in patch2: unchanged: --- a/paragraphs.field_formatter.inc +++ b/paragraphs.field_formatter.inc @@ -13,7 +13,7 @@ function paragraphs_field_formatter_info() { 'paragraphs_view' => array( 'label' => t('Paragraphs items'), 'field types' => array('paragraphs'), - 'settings' => array( + 'settings' => array( 'view_mode' => 'full', ), ), @@ -56,11 +56,10 @@ function paragraphs_field_formatter_settings_summary($field, $instance, $view_mo $settings = $display['settings']; $output = array(); - if ($display['type'] == 'paragraphs_view') { $entity_type = entity_get_info('paragraphs_item'); if (!empty($entity_type['view modes'][$settings['view_mode']]['label'])) { - $output[] = t('View mode: @mode', array('@mode' => $entity_type['view modes'][$settings['view_mode']]['label'])); + $output[] = t('View mode: @mode', array('@mode' => $entity_type['view modes'][$settings['view_mode']]['label'])); } else { $output[] = ' '; only in patch2: unchanged: --- a/paragraphs.node_clone.inc +++ b/paragraphs.node_clone.inc @@ -58,7 +58,7 @@ function paragraphs_clone_items($entity_type, &$entity, $field_name, $language = unset($entity->{$field_name}[$language]); foreach ($old_items as $old_item) { - list( , , $bundle) = entity_extract_ids('paragraphs_item', $old_item); + list(, , $bundle) = entity_extract_ids('paragraphs_item', $old_item); /* @var $new_item ParagraphsItemEntity */ $new_item = entity_create('paragraphs_item', array('bundle' => $bundle, 'field_name' => $field_name)); @@ -75,4 +75,4 @@ function paragraphs_clone_items($entity_type, &$entity, $field_name, $language = } } } -} \ No newline at end of file +} only in patch2: unchanged: --- a/plugins/panelizer/entity/PanelizerEntityParagraphsItem.class.php +++ b/plugins/panelizer/entity/PanelizerEntityParagraphsItem.class.php @@ -1,6 +1,6 @@ 1, 'cardinality' => -1, @@ -26,7 +27,7 @@ function paragraphs_test_field_default_field_bases() { 'type' => 'paragraphs', ); - // Exported field_base: 'field_ptest_text' + // Exported field_base: 'field_ptest_text'. $field_bases['field_ptest_text'] = array( 'active' => 1, 'cardinality' => 1, only in patch2: unchanged: --- a/tests/paragraphs_test/paragraphs_test.features.field_instance.inc +++ b/tests/paragraphs_test/paragraphs_test.features.field_instance.inc @@ -1,4 +1,5 @@ 'paragraph_test', 'default_value' => NULL, @@ -59,7 +60,7 @@ function paragraphs_test_field_default_field_instances() { ), ); - // Exported field_instance: 'paragraphs_item-ptest-field_ptest_text' + // Exported field_instance: 'paragraphs_item-ptest-field_ptest_text'. $field_instances['paragraphs_item-ptest-field_ptest_text'] = array( 'bundle' => 'ptest', 'default_value' => NULL, only in patch2: unchanged: --- a/tests/paragraphs_test/paragraphs_test.features.inc +++ b/tests/paragraphs_test/paragraphs_test.features.inc @@ -1,4 +1,5 @@ uuid = 'a6e355d2-2f62-4351-81bc-b72a8c82b8f6'; $display->content = array(); $display->panels = array(); - $pane = new stdClass(); - $pane->pid = 'new-66fc9124-fc10-4bc8-9d66-f0ed5b5245ec'; - $pane->panel = 'center'; - $pane->type = 'entity_field'; - $pane->subtype = 'paragraphs_item:field_ptest_text'; - $pane->shown = TRUE; - $pane->access = array(); - $pane->configuration = array( - 'label' => 'hidden', - 'formatter' => 'text_default', - 'delta_limit' => 0, - 'delta_offset' => '0', - 'delta_reversed' => FALSE, - 'formatter_settings' => array(), - 'context' => 'panelizer', - 'override_title' => 0, - 'override_title_text' => '', - 'override_title_heading' => 'h2', - ); - $pane->cache = array(); - $pane->style = array( - 'settings' => NULL, - ); - $pane->css = array(); - $pane->extras = array(); - $pane->position = 0; - $pane->locks = array(); - $pane->uuid = '66fc9124-fc10-4bc8-9d66-f0ed5b5245ec'; - $display->content['new-66fc9124-fc10-4bc8-9d66-f0ed5b5245ec'] = $pane; - $display->panels['center'][0] = 'new-66fc9124-fc10-4bc8-9d66-f0ed5b5245ec'; + $pane = new stdClass(); + $pane->pid = 'new-66fc9124-fc10-4bc8-9d66-f0ed5b5245ec'; + $pane->panel = 'center'; + $pane->type = 'entity_field'; + $pane->subtype = 'paragraphs_item:field_ptest_text'; + $pane->shown = TRUE; + $pane->access = array(); + $pane->configuration = array( + 'label' => 'hidden', + 'formatter' => 'text_default', + 'delta_limit' => 0, + 'delta_offset' => '0', + 'delta_reversed' => FALSE, + 'formatter_settings' => array(), + 'context' => 'panelizer', + 'override_title' => 0, + 'override_title_text' => '', + 'override_title_heading' => 'h2', + ); + $pane->cache = array(); + $pane->style = array( + 'settings' => NULL, + ); + $pane->css = array(); + $pane->extras = array(); + $pane->position = 0; + $pane->locks = array(); + $pane->uuid = '66fc9124-fc10-4bc8-9d66-f0ed5b5245ec'; + $display->content['new-66fc9124-fc10-4bc8-9d66-f0ed5b5245ec'] = $pane; + $display->panels['center'][0] = 'new-66fc9124-fc10-4bc8-9d66-f0ed5b5245ec'; $display->hide_title = PANELS_TITLE_FIXED; $display->title_pane = '0'; $panelizer->display = $display; only in patch2: unchanged: --- a/tests/paragraphs_test/paragraphs_test.strongarm.inc +++ b/tests/paragraphs_test/paragraphs_test.strongarm.inc @@ -1,4 +1,5 @@ -1); @@ -24,7 +24,7 @@ class paragraphs_handler_relationship extends views_handler_relationship { /** * Add a delta selector for multiple fields. */ - function options_form(&$form, &$form_state) { + public function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); $field = field_info_field($this->definition['field_name']); @@ -49,9 +49,10 @@ class paragraphs_handler_relationship extends views_handler_relationship { /** * Makes sure our table is added to the join. + * * @return mixed */ - function ensure_my_table() { + public function ensure_my_table() { $field = field_info_field($this->definition['field_name']); if (!isset($this->table_alias)) { @@ -67,4 +68,5 @@ class paragraphs_handler_relationship extends views_handler_relationship { } return $this->table_alias; } + }