Comments

harivenu_zyxware created an issue. See original summary.

harivenuv’s picture

Assigned: Unassigned » harivenuv
StatusFileSize
new27.01 KB

Coding standard corrected.

Worked file.

  1. field-collection-item.tpl.php
  2. field_collection.admin.inc
  3. field_collection.api.php
  4. field_collection.entity.inc
  5. field_collection.info.inc
  6. field_collection.install
  7. field_collection.migrate.inc
  8. field_collection.module
  9. field_collection.pages.inc

patch added.

harivenuv’s picture

Assigned: harivenuv » Unassigned
Status: Active » Needs review
jmuzz’s picture

Status: Needs review » Needs work

Thanks @harivenu_zyxware, it would be great to get this module up to date with coding standards.

A couple of things:

    The parameters aren't all the correct type. For example some items are labelled as array's which aren't.
    Function and class summary lines should start with the verb about what the thing does. Ex. "gets" or "fetches". See more details on this page.
harivenuv’s picture

Assigned: Unassigned » harivenuv

hi Jmuzz,

I will improve the coding standards quality based on your comment.

harivenuv’s picture

Status: Needs work » Needs review
StatusFileSize
new27.37 KB

hi,

Created a patch to double check the parameter type again and changed the function summery lines.

harivenuv’s picture

Assigned: harivenuv » Unassigned
harivenuv’s picture

To the maintainers, would be really glad if you could review and merge patch @ #6 and make it available as its very common need.

chris matthews’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll, +Needs rework

The 3 years old patch in #6 does not apply to the latest 7.x-1.x dev snapshot and is probably too old to reroll, but I went ahead and tagged the issue accordingly.

Checking patch field-collection-item.tpl.php...
error: while searching for:
 * Default theme implementation for field collection items.
 *
 * Available variables:
 * - $content: An array of comment items. Use render($content) to print them all, or
 *   print a subset such as render($content['field_example']). Use
 *   hide($content['field_example']) to temporarily suppress the printing of a
 *   given element.
 * - $title: The (sanitized) field collection item label.
 * - $url: Direct url of the current entity if specified.
 * - $page: Flag for the full page state.

error: patch failed: field-collection-item.tpl.php:5
error: field-collection-item.tpl.php: patch does not apply
Checking patch field_collection.admin.inc...
error: while searching for:
  $instances = field_info_instances();
  $field_types = field_info_field_types();
  $bundles = field_info_bundles();
  $header = array(t('Field name'), t('Used in'), array('data' => t('Operations'), 'colspan' => '2'));
  $rows = array();
  foreach ($instances as $entity_type => $type_bundles) {
    foreach ($type_bundles as $bundle => $bundle_instances) {

error: patch failed: field_collection.admin.inc:12
error: field_collection.admin.inc: patch does not apply
Checking patch field_collection.api.php...
error: while searching for:
 * This hook allows modules to determine whether a field collection is empty
 * before it is saved.
 *
 * @param boolean $empty
 *   Whether or not the field should be considered empty.
 * @param FieldCollectionItemEntity $item
 *   The field collection we are currently operating on.

error: patch failed: field_collection.api.php:16
error: field_collection.api.php: patch does not apply
Checking patch field_collection.entity.inc...
Hunk #7 succeeded at 279 (offset 12 lines).
Hunk #8 succeeded at 303 (offset 12 lines).
error: while searching for:
      return $bundle;
    }
  }

  protected function fetchHostDetails() {
    if (!isset($this->hostEntityId)) {
      if ($this->item_id) {

error: patch failed: field_collection.entity.inc:287
error: field_collection.entity.inc: patch does not apply
Checking patch field_collection.info.inc...
error: while searching for:
    return $info;
  }

}
error: patch failed: field_collection.info.inc:27
error: field_collection.info.inc: patch does not apply
Checking patch field_collection.install...
error: while searching for:
    ->expression('revision_id', 'item_id')
    ->execute();

  // Add the archived column
  $archived_spec = array(
    'description' => 'Boolean indicating whether the field collection item is archived.',
    'type' => 'int',

error: patch failed: field_collection.install:124
error: field_collection.install: patch does not apply
Checking patch field_collection.migrate.inc...
error: while searching for:
  /**
   * Import a single field collection item.
   *
   * @param $collection
   *   Collection object to build. Pre-filled with any fields mapped in the
   *   migration.
   * @param $row
   *   Raw source data object - passed through to prepare/complete handlers.
   *
   * @return array|false

error: patch failed: field_collection.migrate.inc:78
error: field_collection.migrate.inc: patch does not apply
Checking patch field_collection.module...
error: while searching for:
      'full' => array(
        'label' => t('Full content'),
        'custom settings' => FALSE,
       ),
    ),
    'access callback' => 'field_collection_item_access',
    'deletion callback' => 'field_collection_item_delete',

error: patch failed: field_collection.module:67
error: field_collection.module: patch does not apply
Checking patch field_collection.pages.inc...
liam morland’s picture

Category: Support request » Task
Status: Needs work » Needs review
Issue tags: -Needs reroll, -needs rework
StatusFileSize
new22.67 KB

New patch attached.

renatog’s picture

Status: Needs review » Needs work

There are functions with doc block comment empty

+/**
+ *
+ */
 function _field_collection_update_7009_new_revision

Please, can you fix it? And we'll be able to commit it

Thanks a lot

liam morland’s picture

The automated coding standards tools will add empty docblocks where they are missing. This clears some coding standards errors. This patch does not fix everything, manually filling-in the function documentation is still needed, but the patch is still an improvement and should be committed.

I'm not in a position to complete all that documentation because I don't know what those functions do.

renatog’s picture

Ah okay, that makes sense.

I know the tool insert the docblock empty and a human needs to go there and fill it with a description

Thank you so much! This patch is very useful - but we need to fill these docblocks before commit

renatog’s picture

Issue tags: +Novice, +Documentation

Inserting a "novice" tag, if someone wants to help us

liam morland’s picture

Is it really novice? Completing the documentation requires understanding what the functions do.

I think it would be better to have empty docblocks than none at all. It is still a step towards compliance.

renatog’s picture

Status: Needs work » Needs review
Issue tags: -Novice

Is it really novice? Completing the documentation requires understanding what the functions do.

Yeah, maybe is not so easy. I don't know if is so hard to read the code to understand, but ok I agree with you

I think it would be better to have empty docblocks than none at all. It is still a step towards compliance.

It another point of view.

Okay, let's evaluate this. Really makes sense

  • RenatoG committed d5ee6a5 on 7.x-1.x authored by Liam Morland
    Issue #2739797 by harivenuv, Liam Morland, RenatoG, Chris Matthews,...
renatog’s picture

Status: Needs review » Fixed

Moved to the dev branch

Thank you so much

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.