Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'dep_ancestor.name' in 'where clause' #40

Open
fbollon opened this issue Apr 29, 2021 · 2 comments
Labels
answered / solved bug Proved error in PanicHD source code

Comments

@fbollon
Copy link

fbollon commented Apr 29, 2021

I have a bug with the search field in the ticket list
In my case the departments feature is disabled and when I try to do a search I get this message

DataTables warning: table id=tickets-table - Exception Message:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'dep_ancestor.name' in 'where clause' (SQL: select count(*) as aggregate from (select `panichd_tickets`.`id`, `panichd_tickets`.`created_at`, `panichd_tickets`.`subject` as `subject`, `panichd_tickets`.`hidden` as `hidden`, `panichd_tickets`.`content` as `content`, `panichd_tickets`.`intervention` as `intervention`, `panichd_tickets`.`status_id` as `status_id`, `panichd_statuses`.`name` as `status`, `panichd_statuses`.`color` as `color_status`, `panichd_priorities`.`color` as `color_priority`, `panichd_categories`.`color` as `color_category`, `panichd_tickets`.`start_date` as `start_date`,  0-CONVERT(date_format(panichd_tickets.start_date, '%Y%m%d%h%i%s'), SIGNED INTEGER) as inverse_start_date, CASE panichd_tickets.limit_date WHEN NULL THEN 0 ELSE 1 END as has_limit, `panichd_tickets`.`limit_date` as `limit_date`,  0-CONVERT(date_format(panichd_tickets.limit_date, '%Y%m%d%h%i%s'), SIGNED INTEGER) as inverse_limit_date, `panichd_tickets`.`limit_date` as `calendar`, `panichd_tickets`.`updated_at` as `updated_at`, `panichd_tickets`.`completed_at` as `completed_at`, `panichd_tickets`.`agent_id`, `panichd_tickets`.`read_by_agent`, `agent`.`name` as `agent_name`, `panichd_priorities`.`name` as `priority`, `panichd_priorities`.`magnitude` as `priority_magnitude`, `members`.`name` as `owner_name`, `creator`.`name` as `creator_name`, `panichd_tickets`.`user_id`, `panichd_tickets`.`creator_id`, `panichd_categories`.`id` as `category_id`, `panichd_categories`.`name` as `category`, group_concat(panichd_tags.id) AS tags_id, group_concat(panichd_tags.name) AS tags, group_concat(panichd_tags.bg_color) AS tags_bg_color, group_concat(panichd_tags.text_color) AS tags_text_color, "" as dep_ancestor_name, (select count(*) from `panichd_attachments` where `panichd_tickets`.`id` = `panichd_attachments`.`ticket_id`) as `all_attachments_count`, (select count(*) from `panichd_comments` where `panichd_tickets`.`id` = `panichd_comments`.`ticket_id` and `type` in (reply, note, completetx) and `type` != note) as `comments_count`, (select count(*) from `panichd_comments` where `panichd_tickets`.`id` = `panichd_comments`.`ticket_id` and `type` in (reply, note, completetx) and `type` != note and `panichd_comments`.`updated_at` > 2021-04-28 00:00:00) as `recent_comments_count`, (select count(*) from `panichd_comments` where `panichd_tickets`.`id` = `panichd_comments`.`ticket_id` and `panichd_comments`.`type` = note) as `internal_notes_count` from `panichd_tickets` left join `users` on `users`.`id` = `panichd_tickets`.`user_id` left join `users` as `members` on `members`.`id` = `panichd_tickets`.`user_id` left join `users` as `creator` on `creator`.`id` = `panichd_tickets`.`creator_id` inner join `panichd_statuses` on `panichd_statuses`.`id` = `panichd_tickets`.`status_id` left join `users` as `agent` on `agent`.`id` = `panichd_tickets`.`agent_id` inner join `panichd_priorities` on `panichd_priorities`.`id` = `panichd_tickets`.`priority_id` inner join `panichd_categories` on `panichd_categories`.`id` = `panichd_tickets`.`category_id` left join `panichd_taggables` on `panichd_tickets`.`id` = `panichd_taggables`.`taggable_id` and `panichd_taggables`.`taggable_type` = PanicHD\PanicHD\Models\Ticket left join `panichd_tags` on `panichd_taggables`.`tag_id` = `panichd_tags`.`id` where `completed_at` is null and `status_id` = 1 and `agent_id` = 4 and (LOWER(`panichd_tickets`.`id`) LIKE %en% or LOWER(`panichd_tickets`.`updated_at`) LIKE %en% or LOWER(`dep_ancestor`.`name`) LIKE %en% or LOWER(`panichd_tickets`.`subject`) LIKE %en% or LOWER(`panichd_tickets`.`intervention`) LIKE %en% or LOWER(`panichd_statuses`.`name`) LIKE %en% or LOWER(`panichd_priorities`.`name`) LIKE %en% or LOWER(`users`.`name`) LIKE %en% or LOWER(`panichd_tickets`.`updated_at`) LIKE %en% or LOWER(`panichd_categories`.`name`) LIKE %en% or LOWER(`panichd_tags`.`name`) LIKE %en%) group by `panichd_tickets`.`id`) count_row_table)
@xaviqv xaviqv added the bug Proved error in PanicHD source code label May 1, 2021
@xaviqv
Copy link
Contributor

xaviqv commented May 1, 2021

Hi @fbollon,

I had the same error in my local app, where I'm using the default PanicHD configuration, so I have departments feature disabled also. I didn't know it.

fbollon added a commit to fbollon/panichd that referenced this issue May 1, 2021
@xaviqv
Copy link
Contributor

xaviqv commented May 2, 2021

Hi @fbollon,

Thanks for your job! I've just added your PR in dev branch ready for the next release.

fbollon pushed a commit to fbollon/panichd that referenced this issue May 4, 2021
fbollon pushed a commit to fbollon/panichd that referenced this issue May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered / solved bug Proved error in PanicHD source code
Projects
None yet
Development

No branches or pull requests

2 participants