Could not retrieve table name from page URL

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Could not retrieve table name from page URL

Post by rpierce » 2022-11-12 04:59

Hi Again,

I am working on creating a dashboard that updates according to a Project selected from the database. I have this working great on my local machine using XAMPP. When I upload to my server it conks out. In the Chrome console I receive the Subject error:
Could not retrieve table name from page URL
When I go to the Source in Chrome I get the following:
AppGini.currentTableName = function() {
// retrieve current table name from page URL
var tables = location.href.match(/\/([a-zA-Z0-9_]+)_view\.php/);
if(undefined == tables || undefined == tables.length || undefined == tables[1]) {
console.warn('AppGini.currentTableName: Could not retrieve table name from page URL');
return false;
}
Please help if you can!

Ray

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Could not retrieve table name from page URL

Post by pbottcher » 2022-11-12 11:49

Hi Ray,

this is actually just a warning that you can ignore, unless you need the Tablename in a script.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Re: Could not retrieve table name from page URL

Post by rpierce » 2022-11-12 22:19

Ohh, that makes sense, because I see that I'm getting the same warning on the XAMPP system. But on the XAMPP system the Google Charts appear in spite of the error. Do you have any ideas on why the charts don't appear on my server? I have show errors turned on for PHP but get none. I initially thought it was a PHP issue, but seem to have ruled that out. It's a puzzle to me.

Ray

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Could not retrieve table name from page URL

Post by pbottcher » 2022-11-13 09:19

This is more difficult to catch as we dont have any further information.
- did you check your database is set up the same as on xampp
- did you check that all the field definitions are set up correctly (rebuild fields)
- can you trace in the browser console the call that should show the Google Charts / provide the data if you do it async
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rpierce
Veteran Member
Posts: 255
Joined: 2018-11-26 13:55
Location: Washington State

Re: Could not retrieve table name from page URL

Post by rpierce » 2022-11-14 17:23

Pascal,

- I copied the database from the server and imported it to xampp when I began the google chart project. I did all the work to get it operational on xampp. Once it was working I ftp'd all the files to the server. Initially I got errors saying something to the effect of, "column cannot be of type 'string'". I can see that for some reason on the server the query is returning strings. Even fields that are int in the database structure. The main numeric value I am working with for the chart is derived from a Count() function, which as I understand it from reading on the internet, always returns an Integer. But my query shows it as a string.

- When I compare the structure of the tables in question, all the fields definitions are identical

- When I go to the browser console I only get the error message first mentioned in this message string. The var_dump() shows the data is in the variable but everything is in a string.

If there is any other information you need to help decipher this, just ask I can email it to you.

Thanks as always,
Ray

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Could not retrieve table name from page URL

Post by pbottcher » 2022-11-17 21:34

Hi Ray,

can you cast the result of your query (if you know that it must be an integer you may use (int), or (float) for a decimal response).
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply