Problem/Motivation

The module currently focuses on block-based output.
For many real-world content models, this is limiting because each content item (for example, each location) should be able to store and render its own Google Place data.

Proposed resolution

Add field-based integration:

  • New field type: Google Place (stores a place ID).
  • Two dedicated field formatters:
    • Google Reviews
    • Google Rating
  • Field widgets:
    • manual place ID input (default)
    • autocomplete widget for editors (shows place label, but stores ID)

Remaining tasks

  • Review and feedback from maintainers.

User interface changes

  • New field type available when adding fields.
  • New formatter options in “Manage display”.
  • New widget options in “Manage form display”.

API changes

  • New field type plugin.
  • New field formatter plugins.
  • New field widget plugins.
  • Local autocomplete endpoint + permission for editor usage.

Data model changes

  • New field storage type for Place IDs.
  • New formatter/widget configuration entries for the added plugins.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mrshowerman created an issue. See original summary.

mrshowerman’s picture

Assigned: mrshowerman » Unassigned
Status: Active » Needs review

sleitner made their first commit to this issue’s fork.

mxh made their first commit to this issue’s fork.

mxh’s picture

Assigned: Unassigned » mxh

mxh changed the visibility of the branch 3580757-add-google-place to hidden.

mxh’s picture

Assigned: mxh » Unassigned

@sleitner Thanks a lot for updating MR10 and for taking the time to work on this feature request.

I had a brief look at the committed changes. Some of the additional changes seem to go a bit beyond the scope of the original request and may have some UX implications. For example, displaying the Place ID as a disabled text field in the form could be somewhat confusing for editors, since it is not necessarily clear what the value represents or why it cannot be edited. This is of course a matter of UX preference, but for this issue I would prefer to stay closer to the original scope.

Since we are still using the legacy API, it also looks like the recent refactorings caused the place_id array entry to no longer be present. This results in a PHP warning when rendering an item using the googlereviews_rating_block theme function.

I therefore added the place_id value back in the same way it was handled up to version 1.1.3:

https://git.drupalcode.org/project/googlereviews/-/merge_requests/15/dif...

As the previous patch no longer applied cleanly to 1.1.4, and since I wanted to keep the implementation focused on the functionality requested in this issue, I rerolled the current patch, restored the missing place_id entry, and kept the changes aligned with the original feature request.

For that reason, I created MR15 as an updated version and marked MR10 as hidden.

Again, thank you very much for your contribution and for spending time on this.

sleitner’s picture

@mxh , @mrshowerman thank you very much for your contribution to the googlereviews module.

The place ID is the value which is saved for the field not the search text, so it made it easier to debug problems. Now I added the place ID to the search result as well.

The place_id array entry was not missing, because it is now part of the request scope and therefore part of the result array.

Without v1 support for fields, it can't be merged, because the API version is a global setting.

sleitner’s picture

Status: Needs review » Fixed

MR10 released as 1.1.5-alpha1

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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