Page 1 of 1
Lookup Table Error
Posted: Thu Dec 08, 2022 9:58 pm
by skyking
I have a table that is using three lookup tables to populate three fields each set as Select in Edit.
When I click on the daoid field pulldown I get the error: Lookup.php(268): Call to a member function getRecordCount() on null
With Debug on, when I load the default daoactivitylist page, debug shows this:
sql: SELECT COUNT(*) FROM recip-name
28 records in it.
sql: SELECT secure
AS lf
, recip-name
AS df
, '' AS df2
, '' AS df3
, '' AS df4
FROM recip-name
sql: SELECT COUNT(*) FROM guilds
sql: SELECT guildid
AS lf
, guild
AS df
, '' AS df2
, '' AS df3
, '' AS df4
FROM guilds
That is two of the three lookup tables. The third lookup table dao-names is not getting used in list or add (and I assume edit and view too)
Why is this lookup table not getting called? It is setup like the other two lookup tables and there are 28 records in it.
Re: Lookup Table Error
Posted: Thu Dec 08, 2022 10:30 pm
by arbei
skyking wrote:
I get the error: Lookup.php(268): Call to a member function getRecordCount() on null
That means the table object is not found, make sure you use v2023.8 and have selected the lookup table to generate.
Re: Lookup Table Error
Posted: Thu Dec 08, 2022 11:35 pm
by skyking
I upgraded to .8
I removed all three lookup tables and no errors, can search, list, edit.
I can add back the guildid field lookup table guilds with link field guildid and display field guild and still no errors
If I then add back the daoid field lookup table dao-names with link field daoid and display field dao-name I can do search but list throws error:
PDO::query(): Argument #1 ($query) cannot be empty
It is not processing SQL queries to the dao-names table correctly it appears. dao-names has 28 records and a manual SQL SELECT query works fine.
I tied using a different lookup table for field daoid and it worked fine, no errors.
When I change it back to the dao-names lookup table it doesn't get queried and fails.
Re: Lookup Table Error
Posted: Fri Dec 09, 2022 5:16 am
by skyking
Noticed this in the error display under Sessions:
daocontrib_MySqlEngines Array ( [DB] => Array ( [recip-name] => 1 [dao-activity] => 1 [guilds] => 1 ) )
Notice the lookup table dao-names is missing
recip-name is a separate published table, dao-activity is a published table, guilds is a lookup table
Re: Lookup Table Error
Posted: Fri Dec 09, 2022 6:33 am
by skyking
dao-names is not a published table.
Re: Lookup Table Error
Posted: Fri Dec 09, 2022 9:05 am
by arbei
skyking wrote:
dao-names is not a published table.
arbei wrote:
make sure you ... have selected the lookup table to generate.
You still need to generate the <LookupTable>.php even the table is not used for List/View, etc..
Re: Lookup Table Error
Posted: Fri Dec 09, 2022 10:42 am
by skyking
Thank you very much for that suggestion.
I generated the dao_names.php and it's now included in the SQL queries and populates the daoid field pulldown.