Google Programmable Search Engine allows the creation of custom search engines for a website. Integrating with the core Drupal search functionality, this module provides for the creation of search pages that use a JSON API to retrieve results from a Google custom search engine.
Support for both the Google Custom Search JSON API and the Google Custom Search Site Restricted JSON API is provided.
Previously, the google_cse module provided integration with Google Custom Search. However, Google rebranded as Google Programmable Search and the google_cse module does not provide support for the JSON APIs. After discussions with some of the google_cse maintainers, the google_cse module will also not support the JSON API going forward as indicated here: https://www.drupal.org/project/google_cse/issues/3279974
Project link
https://www.drupal.org/project/google_json_api
Git instructions
git clone --branch '1.0.x' https://git.drupalcode.org/project/google_json_api.git
Comments
Comment #2
LuongGiap commentedHi @tzura,
I ran Drupal Coding Standards, You can review and fix.
Comment #3
avpadernoComment #4
avpadernoThank you for applying! Reviewers will review the project files, describing what needs to be changed.
Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smother review.
To reviewers: Please read How to review security advisory coverage applications, What to cover in an application review, and Drupal.org security advisory coverage application workflow.
Since the project is being used for this application, for the time this application is open, only the user who created the application can commit code.
Comment #5
timozura commented@LuongGiap Thanks for identifying the formatting issues. They have been corrected.
Comment #6
avpadernoThe correct placeholder for URLs is :variable as shown in the documentation for
FormattableMarkup::placeholderFormat(). That is the placeholder used also by Drupal core code for URLs that take to drupal.org.If validation isn't required, that method can be removed.
The parent method doesn't return any value, so
returncan be removed. To call the parent method,parent::submitForm($form, $form_state);is sufficient.For a class constructor,
{@inheritdoc}isn't used.It's not necessary to implement those methods, since the parent class already implement them using that code.
Any dependency must be injected using Dependency Injection. To log an exception, the code used by
watchdog_exception()should be used. The function is going to be deprecated in Drupal 10; that's why I am not suggesting to call it.See the previous point about the correct placeholder to use for URLs for how a URL is placed in a translatable string.
See
OEmbed::submitConfigurationForm()for how a plugin submits its configuration form. (Getting a configuration object from$this->configFactory->getEditable()isn't necessary.)For hook documentation, it's necessary only the first line. The other one isn't necessary, since the first one already link the function to the
hook_help()documentation.Comment #7
timozura commentedThanks, @apaderno
I've gone through your review and made appropriate changes. Appreciate your input.
Comment #8
avpadernoComment #9
avpadernoThank 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 too.
Comment #10
timozura commentedThanks, @apaderno! Appreciate the assistance!