Module description:

Module Autocomplete Node search will provide you a block which you can configure in any region and search any node title.

After hitting enter it will get redirected to the searched page.

You can find this block by navigating through `admin/structure/block`.

If you are configuring `Autocomplete Node search` for anonymous users, permission should be given for anonymous users.

If your search yields no result, no redirection will take place. Hitting enter/submit button will give you back the existence page on which you were earlier.

Autocomplete Node Search administration pages

Autocomplete node search
Configure Autocomplete Node Search permissions

Project Page : https://www.drupal.org/sandbox/sugandhkhanna/2839494

GIT Instructions

One-Time Only
Setting up repository for the first time

git clone --branch 8.x-1.x https://git.drupal.org/sandbox/sugandhkhanna/2839494.git autocomplete_node_search
cd autocomplete_node_search

pareview result
https://pareview.sh/node/806

Manual Reviews of other projects:
https://www.drupal.org/node/2830563#comment-11982373
https://www.drupal.org/node/2859833#comment-11982351
https://www.drupal.org/node/2857832#comment-11982422
https://www.drupal.org/node/2863688#comment-12006060
https://www.drupal.org/node/2863759#comment-12006085
https://www.drupal.org/node/2863759#comment-12007667
https://www.drupal.org/node/2864153#comment-12007676

Comments

sugandhkhanna2 created an issue. See original summary.

sugandhkhanna2’s picture

StatusFileSize
new5.04 KB
PA robot’s picture

Status: Needs review » Needs work

Git clone command for the sandbox is missing in the issue summary, please add it.

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

ankush_03’s picture

Hi sugandhkhanna2,

Below are my manual review

Manual review of the 8.x-1.x branch:

1 : path -> /src/controller/AutocompleteQueryHandler.php

Please add t() function on line 41 $matches = array('Result not found.');

On line 36 which is $alias = (strlen($alias) > 23) ? substr($alias, 0, 20) . '...' :
Please take as constant and make it configurable.

2: path -> /src/plugin/block/ANSBlock.php

Please provide proper description of block.

prashant114606’s picture

Hi @sugandhkhanna2,

This module is not working for me. I am not able to find "node:title" and whenever i am trying to click on submit button it throws an error for me(Kindly check the screenshot for reference).

Manual Review:

  • Whenever i try to access /nodename/autocomplete/multiple page i get a blank page. please let me know if i am missing something
  • It is a good practice to add hook_help in .module file
  • I would suggest you to add configure in .info.yml file

ANSBlock.php

37

  /**
   * {@inheritdoc}
   */
  public function validateForm(array &$form, FormStateInterface $form_state) {

  }

I would recommend no need to write this function untill you don't want to do some validation from your end.

  • Try to use dependency injection (3rd screenshot is related to it.)
  • AutocompleteQueryHandler.php

    27

     $nids = \Drupal::entityQuery('node')
    

ANSBlock.php

22

    $builtForm = \Drupal::formBuilder()->getForm('Drupal\autocomplete_node_search\Form\AutocompleteNodeSearch');
   

Recommendation: 'formBuilder' service should be injected.

visabhishek’s picture

@sugandhkhanna2 : Please add the project page URL and git clone command in the issue summary.

sugandhkhanna2’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new6.17 KB
PA robot’s picture

Issue summary: View changes

Fixed the git clone URL in the issue summary for non-maintainer users.

I'm a robot and this is an automated message from Project Applications Scraper.

sugandhkhanna2’s picture

Issue summary: View changes
sugandhkhanna2’s picture

Status: Needs review » Needs work
sugandhkhanna2’s picture

Status: Needs work » Needs review
visabhishek’s picture

Issue summary: View changes
sugandhkhanna2’s picture

Issue summary: View changes
sugandhkhanna2’s picture

Issue summary: View changes
kumaratulesh’s picture

Status: Needs review » Needs work
StatusFileSize
new11.5 KB
new19.76 KB

I have done manual review of your code and find one issue based on below scenario:

1) First create a node title like "Test:12"
2) Search this node in your block (see screenshot: case_1.png)
3) Hit enter/submit button you will get the error (see screenshot: case_2.png)

Solution: You will have to change the logic of code "explode(':', $form_data);" under submitForm function.

PA robot’s picture

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

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

sugandhkhanna2’s picture

Status: Closed (won't fix) » Needs review
sugandhkhanna2’s picture

Issue summary: View changes
sugandhkhanna2’s picture

Issue summary: View changes
sugandhkhanna2’s picture

Issue tags: +PAreview: review bonus
sugandhkhanna2’s picture

Priority: Normal » Major
sugandhkhanna2’s picture

Priority: Major » Normal
klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus +PAreview: security
StatusFileSize
new1.38 KB

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

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: ...ew_temp/autocomplete_node_search/src/Form/AutocompleteNodeSearch.php
    --------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------
     42 | WARNING | node_load_multiple() calls should be avoided in classes,
        |         | use dependency injection and the "entity_type.manager"
        |         | service instead
    --------------------------------------------------------------------------
    
    Time: 40ms; Memory: 4Mb
    
  • No automated test cases were found, did you consider writing Simpletests or 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. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. The git repository contains an additional folder "autocomplete_node_search" which should be removed. The files should be in the repository root.
  2. autocomplete_node_search.info.yml: dependency to the node module is missing, because your module will not work without it, right?
  3. autocomplete_node_search_help(): all user facing text must run through t() for translation.
  4. ANSBlock::build(): Do not hard-code class names in strings, use AutocompleteNodeSearch::class instead.
  5. AutocompleteNodeSearch: the is form does not respect node access grants when performing the query. node_load_multiple() will load ALL nodes regardless of access, so that must not be used here. Use an entity query instead. "When adding a node listing to your module, be sure to use an entity query, which will add a tag of "node_access". This will allow modules dealing with node access to ensure only nodes to which the user has access are retrieved" from https://api.drupal.org/api/drupal/core!modules!node!node.module/group/no... . See also https://www.drupal.org/node/1827278 . This isa currently a security blocker. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

sugandhkhanna2’s picture

Issue tags: -PAreview: security
sugandhkhanna2’s picture

Issue tags: +PAreview: security
sugandhkhanna2’s picture

Issue tags: -PAreview: security
sugandhkhanna2’s picture

Issue tags: +PAreview: security
sugandhkhanna2’s picture

Thanks klausi for your valuable time. All points that you have mentioned are fixed now.

sugandhkhanna2’s picture

Issue summary: View changes
sugandhkhanna2’s picture

Issue tags: +PAreview: review bonus
sugandhkhanna2’s picture

Issue summary: View changes
sugandhkhanna2’s picture

Status: Needs work » Needs review
sugandhkhanna2’s picture

Issue summary: View changes
sugandhkhanna2’s picture

Issue summary: View changes
harsh.behl’s picture

Hi sugandhkhanna2,

I think you have solved all the issues described above by @klausi & I can not find any application blocker in your code.

harsh.behl’s picture

Status: Needs review » Reviewed & tested by the community
sugandhkhanna2’s picture

Issue tags:
avpaderno’s picture

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

Thank you for your contribution!

I updated your account so you can opt into security advisory coverage now.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. 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.

Thanks go the dedicated reviewer(s) as well.

avpaderno’s picture

sugandhkhanna2’s picture

Thank you Kiamlalumo.

Also I require credits as I'm not able to Opt into security advisory coverage.

avpaderno’s picture

Sorry, I forgot to click on "Save" after setting your account. Now you are a vetted user, and you can opt-in to the security advisory coverage.

Status: Fixed » Closed (fixed)

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