dalenguyen / firebase-wordpress-plugin

A plugin that helps to integrate Firebase to WordPress
https://firebase-wordpress-docs.readthedocs.io
GNU General Public License v2.0
111 stars 31 forks source link

Error getting data from Firestore database using number data_fields in shortcode #139

Closed rubenalonsoes closed 3 years ago

rubenalonsoes commented 3 years ago

Describe the bug Using for example this shortcode [firestore collection_name='ranking' document_name='from-queries' display_fields='user_real_name,ie_engagement'] when the display_fields are all strings is ok, but in this case that ie_engagement is a number the output is an error: "e.includes is not a function"

To Reproduce Steps to reproduce the behavior:

  1. Use the shortcode [firestore collection_name='ranking' document_name='from-queries' display_fields='user_real_name,ie_engagement']
  2. Use a Document with Number fields (or other that are not String)
  3. Set the display_fields paraemters with that Not-String fields
  4. See error: "e.includes is not a function"

Expected behavior A output as a normal string/number (in decimal numbers it would be great to be able to define the number of decimals)

Screenshots Sample: https://miposicionamientoweb.es/pruebas/?docId=rubenalonsoes

Desktop (please complete the following information):

Additional context The database is about Instagram users, and the idea is get the data about the username indicated in the URL variable docId (it would possible change the name of this variable for my own, for example "user"?)

Thanks!

dalenguyen commented 3 years ago

This is fixed in v2.1.0 https://wordpress.dalenguyen.me/dynamic-display-firestore-data-from-table/?docId=55fe5130-7a64-11ea-98e5-b9eb62c4e611