You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found another potentially related issue with table prefixes.
AssociateAction and AttachAction are building the wrong name inside of the SQL query with a database prefix. When using ->preloadRecortSelect() the records do load up with no issue but when using the search function the Resource breaks. I did some debugging and noticed that the SQL queries are being misconstructed because they aren't using the table prefix.
I have a prefix my_prefix inside of config/database.php and AssociateAction seems to use table_name instead of my_prefix_table_name causing an error inside of the relationship modals.
ERROR: missing FROM-clause entry for table "my_table" at character 106
STATEMENT: select "my_prefix_table_name"."title", "my_prefix_table_name"."id" from "my_prefix_table_name" where (lower(table_name.title::text)::text like $1) and not exists (select * from "my_prefix_courses" where "my_prefix_table_name"."course_id" = "my_prefix_courses"."id" and "my_prefix_courses"."id" = $2) order by "my_prefix_table_name"."title" asc limit 50
The issue is in the call to lower(table_name.title) where it should be lower("my_prefix_table_name".title)
Inverse relationship is derived as plural of the model name while it should be singular.
Donate 💰 to fund this issue
The text was updated successfully, but these errors were encountered: