MySQL error 1054: Unknown column 'config.deleted' in 'where clause'

I’m running 8.1.2 and have noticed the Suitecrm.log is full of this same error;

Thu Sep 22 03:29:50 2022 [2212005][1][FATAL] Mysqli_query failed.
Thu Sep 22 03:29:50 2022 [2212005][1][FATAL] Query Failed: SELECT favorites.*
FROM favorites
JOIN config ON ( config.id = favorites.parent_id )
WHERE favorites.assigned_user_id = ‘1’
AND favorites.parent_type = ‘Administration’
AND favorites.deleted = 0
AND config.deleted = 0
ORDER BY favorites.date_entered DESC LIMIT 0,10: MySQL error 1054: Unknown column ‘config.deleted’ in ‘where clause’

It appears that the ‘config’ table does not have an ‘id’ field nor a ‘deleted’ field.

On further investigation, this appears to come from the getModuleFavorites(string $module) function in ;
include/portability/Services/Favorites/FavoritesManagerPort.php

Does anyone know what’s going on here?
Is there a fix for this please?

Thanks
Terry

We are experiencing the same thing with the same version installed on shared hosting via Softaculus.

That looks like a bug, I would check if it is already reported on GitHub, if not, then please add an Issue there.

I’m working on creating a Github issue for this.

It would be great if one of you could get us a full stack trace of that FATAL… @TerryL @Davlet

Hi pgr

My suiteCRM is on a public hosting site and so I don’t have access to the php error logs. Unless there is a way in cpanel to get what you want, what I have previously posted is all I have.

Sun Sep 25 19:54:52 2022 [14598][1][FATAL]  Query Failed: SELECT favorites.*
                  FROM favorites
                  JOIN config ON ( config.id = favorites.parent_id )
                  WHERE favorites.assigned_user_id = '1'
                    AND favorites.parent_type = 'Administration'
                    AND favorites.deleted = 0
                    AND config.deleted = 0
                  ORDER BY favorites.date_entered DESC LIMIT 0,10: MySQL error 1054: Unknown column 'config.deleted' in 'where clause'

@pjdm thanks but if you can get a stack trace that’s what would really help, to know which function calls led to that query being generated.

I think SuiteCRM has that option in Admin / Settings, but I’m not sure, and I can’t check now. If it doesn’t mention stack traces, maybe it’s called “developer mode” or something.

I do know there is a config.php option that can be set to true, it’s called show_log_trace

Thanks!

There is nothing more than what @pjdm posted with both stack trace and dev mode enabled

The post you edited and deleted had stack traces, but of the previous errors, not of this one.

The trace I need should come immediately after the MySQL FATAL error, with a bunch of lines numbered #0, #1, #2, etc

Yeah that’s why I deleted them, they weren’t relevant. This here has no stack trace

I’m sure it’s possible to get them, I’m not sure why you’re not seeing it, maybe there is some other way.

So many problems would be solved in a much quicker and easier way if this PR I made more than two years ago had been merged… sigh…