All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Please read about the changes to BoldMinded add-on licensing.

Ticket: modify_search_query references exp_members.group_id which no longer exists in EE6

Status Resolved
Add-on / Version Publisher 3.3.1
Severity
EE Version 6.0.3

Paul Nash

Jun 09, 2021

Attempting to implement EE’s simple search results in an error caused by publisher’s hook to modify the query before it is performed.

Line 226 of publisher/legacy/libraries/Publisher_search.php uses m.group_id - changing this to m.role_id fixes the search, though I am unsure why the member group/role is needed at that point, so not sure if this breaks something else.

Below is the error generated before modifying Publisher_search.php

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘m.group_id’ in ‘field list’:
SELECT DISTINCT(pt.entry_id), pt.entry_id, pt.channel_id, t.forum_topic_id, t.author_id, t.ip_address, pt.title, pt.url_title, t.status, t.view_count_one, t.view_count_two, t.view_count_three, t.view_count_four, t.allow_comments, t.comment_expiration_date, t.sticky, t.entry_date, t.year, t.month, t.day, t.entry_date, t.edit_date, t.expiration_date, t.recent_comment_date, t.comment_total, t.site_id as entry_site_id, w.channel_title, w.channel_name, w.search_results_url, w.search_excerpt, w.channel_url, w.comment_url, w.comment_moderate, w.channel_html_formatting, w.channel_allow_img_urls, w.channel_auto_link_urls, w.comment_system_enabled, m.username, m.email, m.screen_name, m.signature, m.sig_img_filename, m.sig_img_width, m.sig_img_height, m.avatar_filename, m.avatar_width, m.avatar_height, m.photo_filename, m.photo_width, m.photo_height, m.group_id, m.member_id, md.* , exp_publisher_data_field_5.field_id_5 AS field_id_5, exp_publisher_data_field_96.field_id_96 AS field_id_96 FROM exp_channel_titles AS t LEFT JOIN exp_channels AS w ON t.channel_id = w.channel_id LEFT JOIN exp_publisher_titles AS pt ON pt.entry_id = t.entry_id AND pt.lang_id = 1 AND pt.status = ‘open’ LEFT JOIN exp_channel_titles ON exp_channel_titles.entry_id = pt.entry_id LEFT JOIN exp_channels ON pt.channel_id = exp_channels.channel_id LEFT JOIN exp_channel_data ON pt.entry_id = exp_channel_data.entry_id LEFT JOIN exp_comments ON pt.entry_id = exp_comments.entry_id LEFT JOIN exp_publisher_category_posts ON exp_publisher_category_posts.entry_id = pt.entry_id AND exp_publisher_category_posts.lang_id = pt.lang_id AND exp_publisher_category_posts.status = pt.status LEFT JOIN exp_categories ON exp_categories.cat_id = exp_publisher_category_posts.cat_id LEFT JOIN exp_publisher_data_field_5 ON pt.entry_id = exp_publisher_data_field_5.entry_id AND pt.lang_id = exp_publisher_data_field_5.lang_id AND pt.status = exp_publisher_data_field_5.status LEFT JOIN exp_publisher_data_field_96 ON pt.entry_id = exp_publisher_data_field_96.entry_id AND pt.lang_id = exp_publisher_data_field_96.lang_id AND pt.status = exp_publisher_data_field_96.status LEFT JOIN exp_members AS m ON m.member_id = t.author_id LEFT JOIN exp_member_data AS md ON md.member_id = m.member_id WHERE t.entry_id IN (438, 60, 63, 95, 96, 109, 191, 222, 272, 339, 354, 374, 386, 393, 413, 414, 418, 481, 485, 488, 502, 504, 506, 517, 530, 535, 537, 539, 553, 565, 566, 585, 593, 594, 599, 633, 643, 648, 651, 653, 678, 687, 702, 758, 843, 855, 851, 888, 892, 894, 897, 950) ORDER BY t.entry_date desc

#0 ee/legacy/database/drivers/mysqli/mysqli_driver.php(112): CI_DB_mysqli_connection->query(‘SELECT DISTINCT…’)
#1 ee/legacy/database/DB_driver.php(260): CI_DB_mysqli_driver->_execute(‘SELECT DISTINCT…’)
#2 ee/legacy/database/DB_driver.php(175): CI_DB_driver->simple_query(‘SELECT DISTINCT…’)
#3 ee/ExpressionEngine/Addons/search/mod.search.php(845): CI_DB_driver->query(‘SELECT DISTINCT…’)
#4 ee/ExpressionEngine/Addons/search/mod.search.php(941): Search->build_standard_query()
#5 ee/ExpressionEngine/Addons/search/mod.search.php(212): Search->getAllQueryParts()
#6 ee/legacy/libraries/Actions.php(175): Search->do_search()
#7 ee/legacy/libraries/Core.php(522): EE_Actions->__construct(true, Object(Closure))
#8 ee/legacy/controllers/ee.php(51): EE_Core->generate_action(true)
#9 [internal function]: EE->index()
#10 ee/ExpressionEngine/Core/Core.php(251): call_user_func_array(Array, Array)
#11 ee/ExpressionEngine/Core/Core.php(111): ExpressionEngine\Core\Core->runController(Array)
#12 ee/ExpressionEngine/Boot/boot.php(161): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#13 public/index.php(164): require_once(’...’)
#13 public/index.php(164): require_once(’...’)

#1

BoldMinded (Brian)

Thanks for pointing this out, I’ll take a look as soon as I can get to it.

#2

BoldMinded (Brian)

Comment has been marked private.

#3

Paul Nash

Thanks, the search is now working as expected.

Login to reply