No blocks displayed

Created on 14 June 2023, about 1 year ago
Updated 16 June 2023, about 1 year ago

Problem/Motivation

I cannot place the two blocks anywhere. I tried many ways, but without success. I configured a Google maps API key without restrictions, and a Place ID from here: https://developers.google.com/maps/documentation/javascript/examples/pla...

What is missing?
Does anyone else experience the same thing?

Steps to reproduce

1. Start a simplytest.me test with drupal core and googlereviews.
2. Configure a google Maps API key without restrictions, and a known Place ID, eg. Eiffel tower in Paris: ChIJLU7jZClu5kcR4PcOOO6p3I0
3. Place the Google Reviews blocks in any region.
4. The block are not displayed and there are no error messages

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Closed: works as designed

Version

1.1

Component

Miscellaneous

Created by

πŸ‡­πŸ‡ΊHungary fox mulder

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @fox mulder
  • πŸ‡³πŸ‡±Netherlands ptitb

    Hi, to be able to help you I need the drupal and module version you’re using as well as the errors that are in the logs and/or on screen.

  • πŸ‡­πŸ‡ΊHungary fox mulder

    The site where I want to use the Google reviews module
    Core version: 9.4.10
    Google reviews version: 1.1.2

    simplytest.me test:
    Core version: 9.5.8
    Google reviews version: 1.1.2

    I also tried changing the code on the site where I can access the code of the module. I modified the build() functions of the blocks, but the blocks still don't appear:
    GoogleReviewsBlock.php:

      public function build() {
    /*
        $config = $this->getConfiguration();
        $reviews = $this->getGoogleData->getGoogleReviews(['rating', 'reviews'], $config['max_google_reviews'], $config['google_reviews_sorting']);
        if (!empty($reviews)) {
          $renderable = [
            '#attached' => ['library' => ['googlereviews/googlereviews.reviews']],
            '#theme' => 'googlereviews_reviews_block',
            '#reviews' => $reviews['reviews'],
            '#place_id' => $reviews['place_id'],
          ];
    
          return $renderable;
        }
    */
    return ['#markup' => t('GoogleReviewsBlock')];
      }

    GoogleRatingBlock.php:

      public function build() {
    /*
        $rating = $this->getGoogleData->getGoogleReviews([
          'rating',
          'user_ratings_total',
        ]);
    
        if (!empty($rating)) {
          $rating_percentage = ($rating['rating'] / 5) * 100;
    
          $renderable = [
            '#attached' => ['library' => ['googlereviews/googlereviews.rating']],
            '#theme' => 'googlereviews_rating_block',
            '#user_ratings_total' => $rating['user_ratings_total'],
            '#rating' => $rating['rating'],
            '#rating_percentage' => $rating_percentage,
            '#place_id' => $rating['place_id'],
          ];
    
          return $renderable;
        }
    */
        return ['#markup' => t('GoogleRatingBlock')];
      }
  • πŸ‡³πŸ‡±Netherlands ptitb

    Can you tell me what’s in the error logs on the site and php error logs on the server where you can access the code?

  • πŸ‡­πŸ‡ΊHungary fox mulder

    There are no error message on the screen nor in the logs...

  • πŸ‡­πŸ‡ΊHungary fox mulder

    I'm sorry for your invested time and attention... The source of the problem is the bad configuration on the Google Maps API, and Place api side
    I don't know what's wrong yet, but probably your module works properly

    Thank you!

  • Status changed to Closed: works as designed about 1 year ago
  • πŸ‡³πŸ‡±Netherlands ptitb

    I just tested it with the Drupal version you used and indeed found it it's working normally.
    Good luck!

Production build 0.69.0 2024