The module "Imagefield default alt & title" adds alts and titles for images
to where they are not, taking them out of the title material.

Project link

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

Git instructions

git clone --branch 8.x-1.x https://git.drupal.org/project/imagefield_default_alt_and_title.git

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alex_optim created an issue. See original summary.

alex_optim’s picture

Issue summary: View changes
Deepthi kumari’s picture

Status: Active » Needs review
FileSize
70 bytes
5.33 KB

Hi,

Fixed Coding Standard Errors. Applied the patch, needs review.

rajveergangwar’s picture

Title: [D8] Imagefield default alt and titl » [D8] Imagefield default alt and title

Making title correct

apaderno’s picture

Priority: Normal » Critical
Issue summary: View changes

To the reviewers: Please set the priority to Normal after reviewing the project.

sleitner’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

Automated Review

Review of the 8.x-1.x branch (commit 0f2a28f):

  • Your README.txt does not follow best practices (headings need to be uppercase). See https://www.drupal.org/node/2181737 .
    • The REQUIREMENTS section is missing.
  • The imagefield_default_alt_and_title.module does not implement hook_help(). See https://www.drupal.org/docs/develop/documenting-your-project/module-docu... .
  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • ESLint has found some issues with your code (please check the JavaScript coding standards).
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/imagefield_default_alt_and_title.js: line 24, col 36, Error - Properties shouldn't be quoted as all quotes are redundant. (quote-props)
    /var/vhosts/c214000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/js/imagefield_default_alt_and_title.js: line 34, col 42, Error - Properties shouldn't be quoted as all quotes are redundant. (quote-props)
    
    2 problems
    
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: ...reviewsh/pareview_temp/src/Form/ImagefieldDefaultAltAndTitleForm.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    --------------------------------------------------------------------------
     38 | WARNING | t() calls should be avoided in classes, use dependency
        |         | injection and $this->t() instead
     63 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
     67 | WARNING | \Drupal calls should be avoided in classes, use
        |         | dependency injection instead
    --------------------------------------------------------------------------
    
    Time: 170ms; Memory: 4Mb
    
  • No automated test cases were found, did you consider writing PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script.


FILE: ...pal/pareviewsh/pareview_temp/imagefield_default_alt_and_title.module
--------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
    |       |     line
 17 | ERROR | [x] Namespaced classes/interfaces/traits should be
    |       |     referenced with use statements
 20 | ERROR | [x] Object operator not indented correctly; expected 6
    |       |     spaces but found 27
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...00000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/README.txt
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 33 | WARNING | Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------


FILE: ...reviewsh/pareview_temp/src/Form/ImagefieldDefaultAltAndTitleForm.php
--------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------
  3 | ERROR | [x] Namespaced classes, interfaces and traits should not
    |       |     begin with a file doc comment
 13 | ERROR | [x] Missing class doc comment
 18 | ERROR | [ ] Public method name
    |       |     "ImagefieldDefaultAltAndTitleForm::getFormID" is not in
    |       |     lowerCamel format
 51 | ERROR | [x] Object operator not indented correctly; expected 6
    |       |     spaces but found 24
 60 | ERROR | [ ] Public method name
    |       |     "ImagefieldDefaultAltAndTitleForm::ImagefieldDefaultAltAndTitleEntityList"
    |       |     is not in lowerCamel format
 68 | ERROR | [x] Object operator not indented correctly; expected 12
    |       |     spaces but found 37
 80 | ERROR | [x] Expected 1 blank line after function; 0 found
 81 | ERROR | [x] The closing brace for the class must have an empty line
    |       |     before it
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...viewsh/pareview_temp/imagefield_default_alt_and_title.links.menu.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 6 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...eviewsh/pareview_temp/imagefield_default_alt_and_title.libraries.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...al/pareviewsh/pareview_temp/imagefield_default_alt_and_title.install
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
   |       |     line
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ...areviewsh/pareview_temp/imagefield_default_alt_and_title.routing.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 7 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

Time: 547ms; Memory: 4Mb

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
No: Causes module duplication and/or fragmentation. Similar: https://www.drupal.org/project/image_auto_alt_filter
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
[No: Does not follow the guidelines for in-project documentation and/or the README Template. See pareview
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. (*) delete git tag 8.x-2.x, ist does not follow Drupal branch naming conventions https://www.drupal.org/node/1015226
  2. (*) when configurating the module on simplytest.me , I get this warning: Warning: Invalid argument supplied for foreach() in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 100 of /home/df924/www/core/lib/Drupal/Core/Render/Element/Checkboxes.php) #0 /home/df924/www/core/includes/bootstrap.inc(582): _drupal_error_handler_real(2, 'Invalid argumen...', '/home/df924/www...', 100, Array) #1 /home/df924/www/core/lib/Drupal/Core/Render/Element/Checkboxes.php(100): _drupal_error_handler(2, 'Invalid argumen...', '/home/df924/www...', 100, Array) #2 [internal function]: Drupal\Core\Render\Element\Checkboxes::valueCallback(Array, false, Object(Drupal\Core\Form\FormState)) #3 /home/df924/www/core/lib/Drupal/Core/Form/FormBuilder.php(1273): call_user_func_array(Array, Array) #4 /home/df924/www/core/lib/Drupal/Core/Form/FormBuilder.php(990): Drupal\Core\Form\FormBuilder->handleInputElement('imagefield_defa...', Array, Object(Drupal\Core\Form\FormState)) #5 /home/df924/www/core/lib/Drupal/Core/Form/FormBuilder.php(1060): Drupal\Core\Form\FormBuilder->doBuildForm('imagefield_defa...', Array, Object(Drupal\Core\Form\FormState)) #6 /home/df924/www/core/lib/Drupal/Core/Form/FormBuilder.php(561): Drupal\Core\Form\FormBuilder->doBuildForm('imagefield_defa...', Array, Object(Drupal\Core\Form\FormState)) #7 /home/df924/www/core/lib/Drupal/Core/Form/FormBuilder.php(318): Drupal\Core\Form\FormBuilder->processForm('imagefield_defa...', Array, Object(Drupal\Core\Form\FormState)) #8 /home/df924/www/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\Core\Form\FormBuilder->buildForm('imagefield_defa...', Object(Drupal\Core\Form\FormState)) #9 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #10 /home/df924/www/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #11 /home/df924/www/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #12 /home/df924/www/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #13 /home/df924/www/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #14 /home/df924/www/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #15 /home/df924/www/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #16 /home/df924/www/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /home/df924/www/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /home/df924/www/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /home/df924/www/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /home/df924/www/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /home/df924/www/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /home/df924/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 /home/df924/www/core/lib/Drupal/Core/DrupalKernel.php(666): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 /home/df924/www/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #25 {main}.
  3. (*) coding standards, see pareview details
  4. (*) check your git user settings, some contributions are not linked to your drupal.org account: Profile -> Git access -> Git configuration

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

apaderno’s picture

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

If you are still working on this application, you should fix all known problems and set the status to Needs review. (See also the project application workflow.)
Please don't change status of this application if you aren't sure you have time to dedicate to this application, or it will be closed again as won't fix.

I am closing this application due to lack of activity.

alex_optim’s picture

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

Please check.

jayprakash01’s picture

Priority: Normal » Major
Issue tags: +drupal coding standards Violation

Here are the some comments on this module regarding Drupal coding standards violation which needs to be corrected.

File and Path : imagefield_default_alt_and_title/src/ImagefieldDefaultAltAndTitleBatch.php

FOUND 13 ERRORS AFFECTING 12 LINES
-----------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Missing class doc comment
14 | ERROR | [x] Visibility must be declared on method "addedData"
15 | ERROR | [x] Short array syntax must be used to define arrays
17 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 21
39 | ERROR | [x] Case breaking statements must be followed by a single blank line
45 | ERROR | [x] Case breaking statements must be followed by a single blank line
59 | ERROR | [x] Short array syntax must be used to define arrays
76 | ERROR | [x] Visibility must be declared on method "addedDataFinishedCallback"
79 | ERROR | [x] Object operator not indented correctly; expected 8 spaces but found 24
90 | ERROR | [x] Visibility must be declared on method "changeValue"
90 | ERROR | [ ] Arguments with default values must be at the end of the argument list
118 | ERROR | [x] Expected 1 blank line after function; 0 found
119 | ERROR | [x] The closing brace for the class must have an empty line before it

File and Path : imagefield_default_alt_and_title/src/Form/ImagefieldDefaultAltAndTitleBatchForm.php

FOUND 20 ERRORS AND 4 WARNINGS AFFECTING 24 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
22 | ERROR | [x] Expected 1 blank line before function; 0 found
24 | ERROR | [x] Expected 1 blank line after function; 0 found
31 | ERROR | [x] Short array syntax must be used to define arrays
35 | ERROR | [x] Short array syntax must be used to define arrays
42 | ERROR | [x] Short array syntax must be used to define arrays
47 | ERROR | [x] Short array syntax must be used to define arrays
55 | ERROR | [x] Short array syntax must be used to define arrays
60 | ERROR | [x] Short array syntax must be used to define arrays
68 | ERROR | [x] Short array syntax must be used to define arrays
70 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
73 | ERROR | [x] Short array syntax must be used to define arrays
79 | ERROR | [x] Short array syntax must be used to define arrays
85 | ERROR | [x] Expected 1 blank line after function; 0 found
93 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 11
107 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
118 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
129 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
133 | ERROR | [x] Short array syntax must be used to define arrays
147 | ERROR | [ ] Public method name "ImagefieldDefaultAltAndTitleBatchForm::ImagefieldDefaultAltAndTitleEntityListByType" is not in
| | lowerCamel format
148 | ERROR | [x] Short array syntax must be used to define arrays
154 | ERROR | [x] Object operator not indented correctly; expected 12 spaces but found 37
166 | ERROR | [x] Expected 1 blank line after function; 0 found
167 | ERROR | [x] The closing brace for the class must have an empty line before it

File and Path : imagefield_default_alt_and_title/src/Form/ImagefieldDefaultAltAndTitleForm.php

FOUND 8 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
13 | ERROR | [x] Missing class doc comment
18 | ERROR | [ ] Public method name "ImagefieldDefaultAltAndTitleForm::getFormID" is not in lowerCamel format
51 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 24
60 | ERROR | [ ] Public method name "ImagefieldDefaultAltAndTitleForm::ImagefieldDefaultAltAndTitleEntityList" is not in lowerCamel format
68 | ERROR | [x] Object operator not indented correctly; expected 12 spaces but found 37
80 | ERROR | [x] Expected 1 blank line after function; 0 found
81 | ERROR | [x] The closing brace for the class must have an empty line before it

File and Path : imagefield_default_alt_and_title/README.txt

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
33 | WARNING | Line exceeds 80 characters; contains 81 characters

File and Path : imagefield_default_alt_and_title/imagefield_default_alt_and_title.module

FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
17 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
20 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 27

File and Path : imagefield_default_alt_and_title/imagefield_default_alt_and_title.install

FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line

apaderno’s picture

Priority: Major » Normal
Status: Needs review » Needs work
Issue tags: -drupal coding standards Violation
alex_optim’s picture

Priority: Normal » Major
Status: Needs work » Needs review

The comments in comment # 9 are incorrect. Because in comment # 8, I added a patch that solves all these problems.
But ok, I pushed this patch in the dev version of the module.
Please check.

apaderno’s picture

Priority: Major » Normal

@alex_optim We don't review patches, but the committed code.
The priority is still Normal since the application has not been waiting for reviews for 3 weeks.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for you contribution!

Review of the 8.x-1.x branch:

  1. README: this module does not depend on the entity module in Drupal 8, please update the README.
  2. If I understand this module correctly then ImagefieldDefaultAltAndTitleBatch will set the very same alt and title property for each image on the site? That is not really useful and will not help for accessibility at all if all images just have the same description?
  3. imagefield_default_alt_and_title.settings config: config schema is missing? https://www.drupal.org/docs/8/api/configuration-api/configuration-schema...
  4. imagefield_default_alt_and_title_unistall(): why do you need to delete something from the state system here? Please add a code comment or remove the uninstall hook. Also this hook implementation has a typo in it, so it will never be called. Please test all code that you write and make sure it is called when you expect it.

But those are just minor things that should be fixed, did not see any security issues that would be application blockers.

batkor’s picture

Status: Reviewed & tested by the community » Needs work
klausi’s picture

Status: Needs work » Reviewed & tested by the community

Let's leave this as RTBC so that it is on the list to be approved.

apaderno’s picture

Assigned: Unassigned » apaderno
Status: Reviewed & tested by the community » Fixed

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 IRC #drupal-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 dedicated reviewers as well.

Status: Fixed » Closed (fixed)

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