This module provides a field widget for entity references. When enabled you are able to group checkbox/radio options into collapsible details elements. Grouping are based on the selected entity references fields.

Project link

https://www.drupal.org/project/group_by_field_widget

CommentFileSizeAuthor
#9 Group_by_Field_Widget-3267803-9.patch68 bytessomesh1999

Comments

Jalite1991 created an issue. See original summary.

jalite1991’s picture

Assigned: jalite1991 » Unassigned
avpaderno’s picture

Title: Group by Field Widget [D9], [D8] » [D9] Group by Field Widget
Issue summary: View changes
Status: Active » Needs work

Thank you for applying! The following branches have a wrong name; they need to be removed to avoid issues.

  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.3
  • 1.1.0
jalite1991’s picture

@apaderno I removed those branches.

jalite1991’s picture

Status: Needs work » Needs review
geoanders’s picture

Looks like you have two README files, when you only need one. Please remove one. I typically
stick with the markdown version.

Ran a code standards scan. See results below:

FILE: /group_by_field_widget/src/Plugin/Field/FieldWidget/GroupByFieldReferenceWidget.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------
 118 | WARNING | Unused variable $options.
 459 | WARNING | #description values usually have to run through t() for translation
-------------------------------------------------------------------------------------------------------------------------------

FILE: /group_by_field_widget/src/Plugin/Field/FieldWidget/GroupByFieldReferenceWidget.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 100 ERRORS AND 2 WARNINGS AFFECTING 78 LINES
-------------------------------------------------------------------------------------------------------------------------------
  48 | ERROR   | [x] Doc comment short description must be on the first line
  54 | ERROR   | [ ] Parameter $entity_type_manager is not described in comment
  54 | ERROR   | [ ] Parameter $entity_type_bundle_info is not described in comment
  71 | ERROR   | [x] Opening brace should be on the same line as the declaration
  78 | ERROR   | [x] Expected 1 blank line after function; 2 found
  85 | ERROR   | [x] Opening brace should be on the same line as the declaration
  96 | ERROR   | [x] Expected 1 blank line after function; 2 found
 103 | ERROR   | [x] Opening brace should be on the same line as the declaration
 115 | ERROR   | [x] Opening brace should be on the same line as the declaration
 119 | ERROR   | [x] Expected 1 space before "?"; 0 found
 119 | ERROR   | [x] Expected 1 space after "?"; 0 found
 119 | ERROR   | [x] Expected 1 space before ":"; 0 found
 119 | ERROR   | [x] Expected 1 space after ":"; 0 found
 133 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 133 | ERROR   | [x] Expected 1 space before "?"; 0 found
 133 | ERROR   | [x] Expected 1 space after "?"; 0 found
 133 | ERROR   | [x] Expected 1 space before ":"; 0 found
 133 | ERROR   | [x] Expected 1 space after ":"; 0 found
 142 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 154 | ERROR   | [x] Expected newline after closing brace
 157 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 173 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 176 | ERROR   | [x] Inline comments must start with a capital letter
 185 | ERROR   | [x] Comments may not appear after statements
 185 | ERROR   | [x] No space found before comment text; expected "// alternative notation" but found "//alternative notation"
 185 | ERROR   | [x] Inline comments must start with a capital letter
 185 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 188 | ERROR   | [x] Expected 1 space after "=>"; 2 found
 188 | ERROR   | [x] Comments may not appear after statements
 195 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
 195 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 221 | ERROR   | [x] Opening brace should be on the same line as the declaration
 224 | ERROR   | [ ] join() is a function name alias, use implode() instead
 233 | ERROR   | [x] Opening brace should be on the same line as the declaration
 241 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 242 | ERROR   | [x] Short array syntax must be used to define arrays
 247 | ERROR   | [x] Inline comments must start with a capital letter
 256 | ERROR   | [x] Expected 1 blank line after function; 2 found
 263 | ERROR   | [x] Opening brace should be on the same line as the declaration
 266 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 270 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 274 | ERROR   | [x] Expected newline after closing brace
 282 | ERROR   | [x] Doc comment short description must end with a full stop
 284 | ERROR   | [ ] Missing parameter comment
 285 | ERROR   | [ ] Missing parameter comment
 286 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 286 | ERROR   | [ ] If there is no return value for a function, there must not be a @return tag.
 286 | ERROR   | [ ] Description for the @return value is missing
 289 | ERROR   | [x] Opening brace should be on the same line as the declaration
 303 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 306 | ERROR   | [ ] Type hint "array" missing for $form_values
 307 | ERROR   | [x] Opening brace should be on the same line as the declaration
 313 | ERROR   | [x] Expected newline after closing brace
 324 | ERROR   | [ ] Description for the @return value is missing
 327 | ERROR   | [x] Opening brace should be on the same line as the declaration
 347 | ERROR   | [x] Inline comments must start with a capital letter
 367 | ERROR   | [x] Parameter comment must end with a full stop
 368 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 371 | ERROR   | [ ] Type hint "array" missing for $field_list
 371 | ERROR   | [ ] Type hint "array" missing for $field_path
 372 | ERROR   | [x] Opening brace should be on the same line as the declaration
 376 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 378 | ERROR   | [x] Inline comments must start with a capital letter
 395 | ERROR   | [x] Expected newline after closing brace
 396 | ERROR   | [x] Equals sign not aligned with surrounding assignments; expected 1 space but found 2 spaces
 399 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 403 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 421 | ERROR   | [ ] Missing parameter comment
 422 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 422 | ERROR   | [x] Expected "bool" but found "boolean" for function return type
 422 | ERROR   | [ ] Description for the @return value is missing
 425 | ERROR   | [x] Opening brace should be on the same line as the declaration
 426 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 428 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 429 | ERROR   | [x] Expected newline after closing brace
 429 | ERROR   | [x] Use "elseif" in place of "else if"
 430 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 433 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 449 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 451 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 451 | ERROR   | [ ] If there is no return value for a function, there must not be a @return tag.
 451 | ERROR   | [ ] Description for the @return value is missing
 453 | ERROR   | [ ] Type hint "[type]" missing for $element
 453 | ERROR   | [ ] Type hint "[type]" missing for $selected
 453 | ERROR   | [ ] Type hint "[type]" missing for $options_key
 453 | ERROR   | [ ] Type hint "[type]" missing for $optionLabel
 454 | ERROR   | [x] Opening brace should be on the same line as the declaration
 455 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 461 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 469 | ERROR   | [x] Short array syntax must be used to define arrays
 477 | ERROR   | [x] Expected newline after closing brace
 479 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 480 | ERROR   | [x] Short array syntax must be used to define arrays
 488 | ERROR   | [x] Expected newline after closing brace
 489 | ERROR   | [x] Short array syntax must be used to define arrays
 491 | ERROR   | [x] Short array syntax must be used to define arrays
 506 | ERROR   | [x] Expected "int" but found "integer" for parameter type
 508 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 511 | ERROR   | [ ] Type hint "[type]" missing for $field_chain
 512 | ERROR   | [x] Opening brace should be on the same line as the declaration
 523 | ERROR   | [x] Expected 1 space after "="; 2 found
 530 | ERROR   | [x] Expected newline after closing brace
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 81 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------


FILE: /group_by_field_widget/README.md
----------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------------
  4 | WARNING | Line exceeds 80 characters; contains 108 characters
  7 | WARNING | Line exceeds 80 characters; contains 452 characters
 11 | WARNING | Line exceeds 80 characters; contains 97 characters
 12 | WARNING | Line exceeds 80 characters; contains 86 characters
----------------------------------------------------------------------------

FILE: /group_by_field_widget/README.txt
-----------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------
  4 | WARNING | Line exceeds 80 characters; contains 108 characters
  7 | WARNING | Line exceeds 80 characters; contains 452 characters
 11 | WARNING | Line exceeds 80 characters; contains 97 characters
 12 | WARNING | Line exceeds 80 characters; contains 86 characters
-----------------------------------------------------------------------------
geoanders’s picture

Status: Needs review » Needs work
avpaderno’s picture

Priority: Normal » Minor
somesh1999’s picture

StatusFileSize
new68 bytes

I removed the syntax errors and warnings. Please check this patch.

avpaderno’s picture

The task of reviewers is to describe what needs to be changed in the project files to have code that follows the coding standards, correctly uses the Drupal API, and doesn't contain security issues. Differently from other issue queues, they don't provide patches.

Patches provided for these applications will be deleted.

avpaderno’s picture

Title: [D9] Group by Field Widget » [1.2.x] Group by Field Widget
Issue summary: View changes
avpaderno’s picture

Status: Needs work » Closed (won't fix)

I am closing this application, since there haven't been replies in more than eight months and the application was open more than eleven months ago.
Feel free to re-open it, once the project has been changed basing on what reported in the last review.

jalite1991’s picture

Status: Closed (won't fix) » Needs review

Drupal 10 compatibility added, and coding standards applied.

avpaderno’s picture

Priority: Minor » Normal

src/Plugin/Field/FieldWidget/GroupByFieldReferenceWidget.php

  /**
   * Drupal\Core\Entity\EntityFieldManagerInterface definition.
   *
   * @var \Drupal\Core\Entity\EntityFieldManagerInterface
   */
  protected $entityFieldManager;

Property descriptions must not repeat the name of the class/interface.

avpaderno’s picture

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the Slack #contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the reviewers.

avpaderno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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